Skip to contents

Reads the "Key Variables" column from the SDTM specification MS Excel file's "Datasets" sheet for the specified domain.

Usage

get_key_vars(
  domain,
  dir,
  filename,
  datasets_sheet = "Datasets",
  dataset_col = "Dataset",
  keyvar_col = "Key Variables"
)

Arguments

domain

string, SDTM domain or supplemental domain code

dir

string, specification directory

filename

string, file name of the specification

datasets_sheet

a string, the sheet name in the specification Excel file that has the key variables, default is "Datasets"

dataset_col

a string, the column name of the domains in the table in datasets_sheet, default is "Dataset"

keyvar_col

a string, the column name of the key variables in the table in datasets_sheet, default is "Key Variables"

Value

a character vector of key variables for the specified domain

Details

The readxl::read_excel() function will causes an access denied warning when reading in a read-only specification file. This does not affect the data import.

Examples

work_dir <- system.file("extdata", package = "sdtmval")
key_vars <- get_key_vars(domain = "XX",
                         dir = work_dir,
                         filename = "spec.xlsx")