set_derived_variables: Apply variable labels to data frame

View source: R/set_derived_variables.R

set_derived_variablesR Documentation

Apply variable labels to data frame

Description

Takes labels from the Derived Variables excel file and applies them to the passed data frame. The excel sheet must have columns "varname" and "label".

Usage

set_derived_variables(data, path, sheet = NULL, drop = TRUE)

Arguments

data

Data frame

path

Path to Derived Variables xls/xlsx file

sheet

Sheet to read. Either a string (the name of a sheet), or an integer (the position of the sheet). Ignored if the sheet is specified via range. If neither argument specifies the sheet, defaults to the first sheet.

drop

Logical indicating whether to drop unlabelled variables

Author(s)

Daniel D. Sjoberg

Examples


trial %>%
  set_derived_variables("derived_variables_sjoberg.xlsx")


ddsjoberg/bstfun documentation built on July 4, 2023, 10:59 a.m.