Description Usage Arguments Details Value Examples
Finds values in x
that are equivalent to values in
from
and substitutes them with corresponding values in to
.
1 |
x |
A vector containing values that will be recoded based on
|
from |
A vector containing the values within |
to |
A vector containing the corresponding value (or values) that
|
warn |
If 'TRUE', a warning will be generated when values in 'x' are not contained in 'from |
default_NA |
If 'TRUE', |
If only a single value is included in to
, then all values in
x
matching
values in from
will be changed to the single value in to
.
Otherwise, the lengths of from
and to
must be equal, and there
can be no duplicated values in from
.
Note that when anticipating output of rc_char
, this function
automatically converts all input arguments to character vectors in the
first step.
A character vector, derived from x
, with 0 or more values
substituted for new ones
1 2 3 4 | x <- as.character(1:10)
from <- as.character(1:10)
to <- letters[1:10]
rc_char(x, from, to)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.