factor_level: user defined factor levels

Description Usage Arguments Value Examples

View source: R/factor_level.R

Description

It turns input to a fator with factor levels order defined sepcifically by user

Usage

1
factor_level(x, level = "alp", ...)

Arguments

x

a vector which is a potential factor

level

Valid levels for x, default is "alp". User defined level character must match the number of levels of x, and must include all values of x. If equals "alp",levels of x appears alphabetically; if equals "asit",levels of x are ordered as they appeared in x.

...

optional arguments to pass to the function factor()

Value

x as a factor with level orders specified

Examples

1
factor_level(iris$Species,level = c("versicolor","setosa","virginica"))

wang114/foofactorsran documentation built on May 4, 2019, 12:57 a.m.