-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into 223_clean_test_code
- Loading branch information
Showing
33 changed files
with
517 additions
and
293 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#' Split xpt file output | ||
#' | ||
#' Per the FDA Study Data Technical Conformance | ||
#' Guide(https://www.fda.gov/media/88173/download) section 3.3.2, dataset files | ||
#' sizes shouldn't exceed 5 GB. If datasets are large enough, they should be | ||
#' split based on a variable. For example, laboratory readings in `ADLB` can be | ||
#' split by `LBCAT` to split up hematology and chemistry data. | ||
#' | ||
#' This function will tell `xportr_write()` to split the data frame based on the | ||
#' variable passed in `split_by`. When written, the file name will be prepended | ||
#' with a number for uniqueness. These files should be noted in the Reviewer Guides per | ||
#' CDISC guidance to note how you split your files. | ||
#' | ||
#' @inheritParams xportr_length | ||
#' @param split_by A quoted variable that will be passed to `base::split()`. | ||
#' | ||
#' @return A data frame with an additional attribute added so `xportr_write()` | ||
#' knows how to split the data frame. | ||
#' | ||
#' | ||
#' @export | ||
#' | ||
#' @examples | ||
#' data("adsl_xportr") | ||
#' adsl <- adsl_xportr | ||
#' | ||
#' adlb <- data.frame( | ||
#' USUBJID = c(1001, 1002, 1003), | ||
#' LBCAT = c("HEMATOLOGY", "HEMATOLOGY", "CHEMISTRY") | ||
#' ) | ||
#' | ||
#' adsl <- xportr_split(adsl, "LBCAT") | ||
xportr_split <- function(.df, split_by = NULL) { | ||
attr(.df, "_xportr.split_by_") <- split_by | ||
|
||
return(.df) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.