Skip to contents

Read all .xpt files in a directory (unzipped TrialMaster archive).
If 7zip is installed, you should probably rather use read_trialmaster() instead.
If a procformat.sas file exists in the directory, formats will be applied.

Usage

read_tm_all_xpt(
  directory,
  ...,
  format_file = "procformat.sas",
  clean_names_fun = NULL,
  split_mixed = FALSE,
  extend_lookup = TRUE,
  datetime_extraction = NULL,
  verbose = getOption("edc_read_verbose", 1),
  key_columns = "deprecated"
)

Arguments

directory

[character(1)]
the path to the unzipped archive using SAS_XPORT format. Will read the extraction date from the directory name.

...

unused

format_file

[character(1)]
the path to the procformat.sas file that should be used to apply formats. Use NULL to not apply formats.

clean_names_fun

[function]
a function to clean column names, e.g. tolower, janitor::clean_names(),...

split_mixed

[logical(1): FALSE]
whether to split mixed datasets. See split_mixed_datasets.

extend_lookup

[character(1): FALSE]
whether to enrich the lookup table. See extend_lookup.

datetime_extraction

[POSIXt(1)]
the datetime of the data extraction. Default to the most common date of last modification in directory.

verbose

[logical(1)]
one of c(0, 1, 2). The higher, the more information will be printed.

key_columns

deprecated

Value

a list containing one dataframe for each .xpt file in the folder, the extraction date (datetime_extraction), and a summary of all imported tables (.lookup). If not set yet, option edc_lookup is automatically set to .lookup.