Skip to contents

Reads the specified domain variable specification sheet from an MS Excel file.

Usage

get_data_spec(domain, dir, filename, arrange_by = "Order")

Arguments

domain

string, SDTM domain or supplemental domain code

dir

string, specification directory

filename

string, file name of the specification

arrange_by

character vector, the column(s) by which to sort the domain sheet, default is "Order"

Value

a data frame of the variable specification for 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. Variables will be arranged in descending order per the "Order" column in the specification.

Examples

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