Learn R Programming

clinUtils (version 0.1.4)

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

Description

Get label of the variables in SAS dataset(s)

Usage

getLabelVars(data, labelVars = NULL)

Value

Named vector with variable labels.

Arguments

data

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

labelVars

(optional) Named character vector with additional labels.

Author

Laure Cougnaud

Examples

Run this code
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"]

Run the code above in your browser using DataLab