View source: R/epi_clean_label.R
epi_clean_label | R Documentation |
This function takes a dataframe and a lookup dataframe that contains the mapping of factors' levels and labels for specific variables. It applies these levels and labels to the corresponding variables in the target dataframe.
epi_clean_label(data_df, lookup_df)
data_df |
A dataframe to which factor levels and labels will be applied. This dataframe should contain columns that match the variable names specified in the lookup dataframe. |
lookup_df |
A lookup dataframe containing at least three columns: |
A modified version of data_df
with specified columns converted to factors
with levels and labels as defined in lookup_df
.
# Assume data_df is already loaded and contains 'ORIGEN' and 'SECTOR' columns
# Assume lookup_df is set up with columns 'variable', 'level', and 'label'
# result_df <- epi_clean_label(data_df, lookup_df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.