This is a shortcut for creating factors with levels as the order of appearance of the specified levels.

cl(...)

Arguments

...

unique elements or vectors with unique elements

Value

A factor (vector)

See also

cc

Examples

factor("b","a")
#> [1] <NA>
#> Levels: a
cl("b","a")
#> [1] b a
#> Levels: b a
x <- c("b","a")
factor(x)
#> [1] b a
#> Levels: a b
cl(x)
#> [1] b a
#> Levels: b a