Description Usage Arguments Value See Also Examples
Recodes values in a data frame by joining with a data frame of recoded values.
1 | leaf_recode(tbl, code_tbl)
|
tbl |
Data frame to modify |
code_tbl |
A data frame of recoding values, either:
Each code column can contain either literal codes or one-sided formulas.
(For example, compare |
A data frame with selected columns recoded
dplyr::case_when()
to recode data using formulas
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | # A data frame of encoded data
acs_nh
# A data frame of recode values
acs_sex_codes
#Recode
leaf_recode(acs_nh, acs_sex_codes)
# You can also specify recoding using formulas
acs_bpl_codes
leaf_recode(acs_nh, acs_bpl_codes)
# Or a mix of values and formulas
acs_educ_codes
leaf_recode(acs_nh, acs_educ_codes)
# You can use also use a data frame with recode values for multiple columns
# Either a wide data frame
acs_codes
leaf_recode(acs_nh, acs_codes)
# Or a long data frame
acs_codes_long
leaf_recode(acs_nh, acs_codes_long)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.