Generate a factor with levels in prescribed order.
Arguments
- x
A character vector.
Value
A factor from x, with levels in the same order as they appear
in within x.
Examples
factor(c('a', 'c', 'b'))
#> [1] a c b
#> Levels: a b c
factorise(c('a', 'c', 'b'))
#> [1] a c b
#> Levels: a c b