loadDataADaMSDTM {clinUtils} | R Documentation |
Load data from ADaM/SDTM file(s).
Description
Load data set in SAS format ('sas7bdat' or 'xpt') into R data.frames, from
files
or raw vector data
.
Usage
loadDataADaMSDTM(
files,
data,
convertToDate = FALSE,
dateVars = "DTC$",
verbose = TRUE,
encoding = "UTF-8",
...
)
Arguments
files |
Character vector with path to ADaM or SDTM file(s). |
data |
Named list with raw vector data
(as supported by: read_sas and read_xpt). |
convertToDate |
logical, if TRUE columns with date/time are converted to
|
dateVars |
vector of columns in |
verbose |
logical, if TRUE (by default) progress messages are printed during execution. |
encoding |
String with encoding, only used if |
... |
Additional parameters for the |
Details
While creating the R data.frames, if date/time variables are present,
those are converted into to R date/time class
(see convertToDateTime
) function.
The labels of the ADaM/SDTM data sets are attached as attributes of the R data.frame.
Value
List of data.frame with data of each ADAM file (if not empty), with special attributes:
'labelVars': named vector with label of the variables
'label': named vector with label of the datasets
Each data.frame contains an additional column called 'dataset'
specifying the name of the files
it was read from.
Author(s)
Laure Cougnaud
Examples
## Not run:
dataFromSAS7bdat <- loadDataADaMSDTM(files = "ae.sas7bdat")
attr(dataFromSAS7bdat, "labelVars") # column labels
dataFromXpt <- loadDataADaMSDTM(files = c("ae.xpt", "dm.xpt"))
attr(dataFromXpt, "labelVars") # column labels
## End(Not run)