getLabelVars: Get label of the variables in SAS dataset(s)

View source: R/loadDataADaMSDTM.R

getLabelVarsR Documentation

Get label of the variables in SAS dataset(s)

Description

Get label of the variables in SAS dataset(s)

Usage

getLabelVars(data, labelVars = NULL)

Arguments

data

Data.frame with SAS dataset(s) or list of those.

labelVars

(optional) Named character vector with additional labels.

Value

Named vector with variable labels.

Author(s)

Laure Cougnaud

Examples

data(dataADaMCDISCP01)
labelVars <- attr(dataADaMCDISCP01, "labelVars")

# extract label for all variables from specified datasets:
getLabelVars(data = dataADaMCDISCP01[c("ADLBC", "ADVS")], labelVars = labelVars)

# extracted from specified labelVars, e.g. to specify custom label for specific variable(s)
labelVarsCustom <- getLabelVars(
  data = dataADaMCDISCP01, 
  labelVars = c(USUBJID = "Subject identifier for my study")
)
labelVarsCustom["USUBJID"]

clinUtils documentation built on Jan. 6, 2023, 5:29 p.m.