View source: R/data-wrangling-factors.R
fct_derive | R Documentation |
Derive factor levels from another factor with unique pair-wise matches
fct_derive(new, old)
new |
A vector |
old |
A factor |
A factor
old <- factor(LETTERS[1:5], LETTERS[c(3, 2, 1, 5, 4)])
old
new <- letters[1:5]
new
factor(new)
fct_derive(new, old)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.