Description Usage Arguments Details Value Author(s)
Recode variables in dataframe to match codes in another dataframe
1 | recodeDFas(df1, df2, cols1, cols2 = cols1)
|
df1 |
dataframe to be recoded |
df2 |
dataframe to copy codes from |
cols1 |
numeric/character vector indicating variables of first dataframe to be recoded |
cols2 |
numeric/character vector indicating variables of second dataframe to copy codes from |
This is a wrapper around recodeAs
.
Each variable of 'df1' listed in 'cols1' will be recoded to the corresponding variable of 'df2'
listed in 'cols2'. If length(cols2) < length(cols1) then the final variable in 'cols2' will be
used for all excess variables in 'cols1'. If 'cols2' is not supplied then it will take the same
value as 'cols1'.
a dataframe (recoded version of 'df1')
Ben Veal
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.