set_derived_variable_labels: Apply variable labels to data frame

View source: R/set_derived_variable_labels.R

set_derived_variable_labelsR Documentation

Apply variable labels to data frame

Description

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

Examples


trial %>%
  set_derived_variable_labels("derived_variables_sjoberg.csv")


pcctc/croquet documentation built on Aug. 10, 2024, 7:04 a.m.