Applies a series of standard data transformations including renaming, recoding, filtering and variable selection.
Arguments
- data_xx
Input dataset.
- filters_ls
Named list of filtering criteria.
- recode_ls
Named list of recoding maps.
- rename_ls
Named list mapping new names to existing variable names.
- output_1L_chr
Output type. One of
"tbl_df","data.frame"or"data.table".- select_chr
Variables to retain.
- transformation_1_fn
Function applied before variable selection.
- transformation_2_fn
Function applied after variable selection.
Details
This function is designed to reduce repetitive data-preparation code when constructing lookup tables and contingency tables.
Transformations are applied in the following order:
Rename variables.
Recode values.
Filter observations.
Apply
transformation_1_fn.Select variables.
Apply
transformation_2_fn.Convert to the requested output format.
See also
Other utility functions:
transform_table_type()
