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)
A vector of recoded values.
An atomic vector of values are to be recoded.
A vector of values to be matched in x
for recoding.
A vector of values to be used as replacement for values in from
.
Value to be used as replacement when cases in from
are not
matched.
Value to be used to recode missing values.