toFactor | R Documentation |
In contrast to the default behaviour of base::as.factor
, this function
uses the unsorted unique values of x
as levels and not sorted unique
values.
toFactor(x)
x |
vector to be converted to factor |
x <- c("b", "c", "a")
as.factor(x) # Levels: a b c
toFactor(x) # Levels: b c a
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.