recode | R Documentation |
recode()
recodes values in x
by matching elements in from
onto values
in to
.
recode(x, from = unique(na.omit(x)), to = from, .no_match = x, .na = NA)
x |
An atomic vector of values are to be recoded. |
from |
A vector of values to be matched in |
to |
A vector of values to be used as replacement for values in |
.no_match |
Value to be used as replacement when cases in |
.na |
Value to be used to recode missing values. |
A vector of recoded values.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.