Skip to contents

Reads-in the "Codelists" sheet from the study's specification MS Excel file and then filters that code list by the variables in the domain

Usage

get_codelist(
  domain,
  dir,
  filename,
  var_col = "Variable",
  codelist_sheet = "Codelists",
  varid_col = "ID"
)

Arguments

domain

string, SDTM domain or supplemental domain code

dir

string, specification directory

filename

string, file name of the specification

var_col

a string, the column name in the domain spec sheet that contains the variables for that domain, default is "Variable"

codelist_sheet

a string, the sheet name of the spec's code list from the spec's .xlsx file, default is "Codelists"

varid_col

a string, the column name in the codelist_sheet table from the spec's .xlsx file that contains the variable names, default is "ID"

Value

a data frame with the code list

Examples

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