Skip to content

Commit

Permalink
updates for deprecated function
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian Chan committed Sep 11, 2024
1 parent 791d032 commit 7967a51
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 7 deletions.
11 changes: 8 additions & 3 deletions R/split.R → R/deprec-split.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#' Split xpt file output
#' Deprecated - Split xpt file output
#'
#' @description
#' `r lifecycle::badge("deprecated")`
#'
#' Per the FDA Study Data Technical Conformance
#' Guide(https://www.fda.gov/media/88173/download) section 3.3.2, dataset files
Expand All @@ -18,8 +21,8 @@
#' knows how to split the data frame.
#'
#'
#' @export
#'
#' @export
#' @examples
#'
#' adlb <- data.frame(
Expand All @@ -29,7 +32,9 @@
#'
#' adlb <- xportr_split(adlb, "LBCAT")
xportr_split <- function(.df, split_by = NULL) {
.Deprecated("xportr_write(max_size_gb = ..")
attr(.df, "_xportr.split_by_") <- split_by

return(.df)
}

#' @rdname xportr_split-deprecated
9 changes: 5 additions & 4 deletions man/xportr_split.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions tests/testthat/test-deprecation.R
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,16 @@ test_that(
expect_error(xportr_type(df, metacore = df_meta))
}
)

## Test 7: xportr_split: using deprecated function gives a warning----
test_that(
"deprecation xportr_split: using deprecated function gives a warning",
{
adlb <- data.frame(
USUBJID = c(1001, 1002, 1003),
LBCAT = c("HEMATOLOGY", "HEMATOLOGY", "CHEMISTRY")
)

expect_warning(adlb <- xportr_split(adlb, "LBCAT"))
}
)

0 comments on commit 7967a51

Please sign in to comment.