-
Notifications
You must be signed in to change notification settings - Fork 115
Description
As a required part of the submission of clinical trial data to the FDA, data must be submission using SAS version 5 transport files (XPT files). In addition to the file format, there are several compliance requirements of the format of those XPT. A detailed account of these requirements can be found in the Study Data Technical Conformance Guide (https://www.fda.gov/media/88173/download) in section 3.3 (Page 14).
Similar to the support added in #562, a part of writing xpts in R we have a need for customizing formats, informats, and lengths written by xpt files. The length attribute in particular is of high priority, as users must be able to control the specified length of a variable, despite this not being applicable within R.
From my limited knowledge of C, ReadStat appears to have functionality for setting formats(
Line 211 in 1b6db6b
const char* var_format(cpp11::sexp x, VarType varType) { |
Right now it looks like write_xpt()
saves formats and informats as $
( #456) but the ability to change that with attr(df$my_var, “format”) <- “DATE9” or something similar would close a gap in our use of R in our workflows.
Lengths for numeric characters should generally remain 8, but a custom length for character variables is necessary and critical for clinical submissions. This functionality is included in similar packages( r-gregmisc/SASxport#20), but given {haven}'s inclusion within the tidyverse, adopting this functional would be of immense value for pharmaceutical industry.
Unfortunately, I don’t have the C skills to parse through a lot of the src files so I wouldn’t be able to assist in that part, but I could get the process of updating the man pages and R functionality if that would be of help.
To clarify the enhancements are:
· Configurable length xpt metadata output via the length attribute for character variables.
· Configurable format xpt metadata output via the “format” attribute.
· Configurable informat xpt metadata output via the informat attribute.