coercion-factor: Factor coercion

coercion-factorR Documentation

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()

\Sexpr[stage=render,results=rd]{generics:::methods_rd("as.factor")}

as.ordered()

\Sexpr[stage=render,results=rd]{generics:::methods_rd("as.ordered")}

Examples

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


generics documentation built on July 6, 2022, 1:08 a.m.