Skip to contents

Takes labels from the Derived Variables CSV file and applies them to the passed data frame. The excel sheet must have columns "df_name", "df_label", "var_name", and "var_label". The returned data frame is also labelled with the value in "df_label".

Usage

set_derived_variable_labels(data, df_name, path, drop = TRUE)

Arguments

data

Data frame

df_name

string indicating the name of the data frame to apply labels to. If not specified, we'll do our best to determine the name of the passed data frame.

path

Path to CSV file

drop

Logical indicating whether to drop unlabeled variables

Author

Daniel D. Sjoberg

Examples

if (FALSE) {
trial %>%
  set_derived_variable_labels("derived_variables_sjoberg.xlsx")
}