recode2: Wrapper for recode from car to allow to recode multiple
columns at once
Description
Wrapper for recode from car to allow to recode multiple
columns at once
Usage
recode2(x, vars = NULL, ...)
Arguments
x
A dataframe.
vars
A vector of variable names or numeric indexes to select the columns to recode.
...
Arguments that are passed on to recode from car
(see ?recode for more info).
recodes
Character string of recode specifications: see below.
as.factor.result
Return a factor; default is TRUE if the column is
a factor, FALSE otherwise.
as.numeric.result
If TRUE (the default), and
as.factor.result is FALSE, then the result will be
coerced to numeric if all values in the result are numerals — i.e.,
represent numbers.
levels
An optional argument specifying the order of the levels
in the returned factor; the default is to use the sort order of
the level names.