Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

coercion-factor

Factor coercion


Description

Coercion functions for creating factors from other existing objects.

Usage

as.factor(x, ...)

as.ordered(x, ...)

Arguments

x

A vector of data.

...

Other arguments passed on to methods.

Details

These functions override non-generic factor coercion functions provided in base so that packages can provide methods for different data types. The default methods call the base versions.

Value

For as.factor(), a factor. For as.ordered(), an ordered factor.

Methods

as.factor()

No methods found in currently loaded packages.

as.ordered()

No methods found in currently loaded packages.

Examples

as.factor(letters[1:5])
as.ordered(letters[1:5])

generics

Common S3 Generics not Provided by Base R Methods Related to Model Fitting

v0.1.0
MIT + file LICENSE
Authors
Hadley Wickham [aut, cre], Max Kuhn [aut], Davis Vaughan [aut], RStudio [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.