.xpt
files in a directoryRead 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.
read_all_xpt(
path,
...,
format_file = "procformat.sas",
clean_names_fun = NULL,
split_mixed = FALSE,
extend_lookup = TRUE,
datetime_extraction = "guess",
verbose = getOption("edc_read_verbose", 1),
directory = "deprecated",
key_columns = "deprecated"
)
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
).
[character(1)
]
the path to the directory containing all .xpt
files.
unused
[character(1)
]
the path to the file that should be used to apply formats. See details. Use NULL
to not apply formats.
[function
]
a function to clean column names, e.g. tolower, janitor::clean_names()
,...
[logical(1): FALSE
]
whether to split mixed datasets. See split_mixed_datasets.
[character(1): FALSE
]
whether to enrich the lookup table. See extend_lookup.
[POSIXt(1)
]
the datetime of the data extraction. Default to the most common date of last modification in directory
.
[logical(1)
]
one of c(0, 1, 2)
. The higher, the more information will be printed.
deprecated
deprecated
format_file
should contain the information about SAS formats. It can be either
a procformat.sas
file, containing the whole PROC FORMAT
or a data file (.csv or .sas7bdat) containing 3 columns: the SAS format name (repeated),
each level, and its associated label. Use options(edc_var_format_name="xxx", edc_var_level="xxx", edc_var_label="xxx")
to specify the names of the columns.