Description Usage Arguments Value Examples
Recodes values of x
based on pairs of values in from
and
to
, outputting a factor. Optionally allows the ordering of factor
levels based on level_idx
.
1 |
x |
vector that will be recoded and turned into a factor |
from |
vector containing all unique values in |
to |
vector containing values that will replace those in |
level_idx |
vector specifying the sequence of levels in
|
A vector or class factor
1 2 3 4 5 | x <- as.character(1:10)
from <- as.character(1:10)
to <- letters[1:10]
level_idx <- rev(1:10)
rc_char(x, from, to, level_idx)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.