xportr! We have designed
xportr to help get your xpt files ready for transport either to a clinical data set validator application or to a regulatory agency This package has the functionality to associate all metadata information to a local R data frame, perform data set level validation checks and convert into a transport v5 file(xpt).
As always, we welcome your feedback. If you spot a bug, would like to see a new feature, or if any documentation is unclear - submit an issue on xportr’s Github page.
xportr is designed for clinical programmers to create CDISC compliant xpt files- ADaM or SDTM. Essentially, this package has two big components to it - writing xpt files with well-defined metadata and checking compliance of the data sets. The first set of tools are designed to allow a clinical programmer to build a CDISC compliant xpt file directly from R. The second set of tools are to perform checks on your data sets before you send them off to any validators or data reviewers.
NOTE: Each check has associated messages and warning.
The first example involves an ADSL data set in the
.sas7bdat format with associated specification in the
adsl <- haven::read_sas("inst/extdata/adsl.sas7bdat") var_spec <- readxl::read_xlsx("inst/specs/ADaM_spec.xlsx", sheet = "Variables") %>% dplyr::rename(type = "Data Type") %>% rlang::set_names(tolower) data_spec <- readxl::read_xlsx("inst/specs/ADaM_spec.xlsx", sheet = "Datasets") %>% rlang::set_names(tolower) %>% dplyr::rename(label = "description") adsl %>% xportr_type(var_spec, "ADSL", "message") %>% xportr_length(var_spec, "ADSL", "message") %>% xportr_label(var_spec, "ADSL", "message") %>% xportr_df_label(data_spec, "ADSL") %>% xportr_write("adsl.xpt")
Please check out the 3 articles within the Articles Tab:
How to write out an xpt file with
Drilling down with
Interfacing with the