Skip to content

Commit

Permalink
replace use of scda with random.cdisc.data (#316)
Browse files Browse the repository at this point in the history
closes #315 

related to [this
issue](insightsengineering/scda#146)
  • Loading branch information
ayogasekaram authored May 16, 2024
1 parent 9bd75a9 commit 5f0a429
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 16 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
### Miscellaneous
* Exported `validate_metadata` function.
* Replaced argument `name` by `archive_name` to comply with the latest version of the `synthetic_cdisc_dataset` function.
* Replaced use of `scda` with `random.cdisc.data`

### Bug fixes
* Fixed `get_raw_data` examples.
Expand Down
19 changes: 9 additions & 10 deletions data-raw/data.R
Original file line number Diff line number Diff line change
@@ -1,30 +1,29 @@
## code to prepare `data` for testing examples
library(scda)
rADAE <- synthetic_cdisc_data("latest")$adae # nolint: object_name_linter.
rADAE <- random.cdisc.data::cadae # nolint: object_name_linter.
usethis::use_data(rADAE)

rADCM <- synthetic_cdisc_data("latest")$adcm # nolint: object_name_linter.
rADCM <- random.cdisc.data::cadcm # nolint: object_name_linter.
usethis::use_data(rADCM)

rADEX <- synthetic_cdisc_data("latest")$adex # nolint: object_name_linter.
rADEX <- random.cdisc.data::cadex # nolint: object_name_linter.
usethis::use_data(rADEX)

rADLB <- synthetic_cdisc_data("latest")$adlb # nolint: object_name_linter.
rADLB <- random.cdisc.data::cadlb # nolint: object_name_linter.
usethis::use_data(rADLB)

rADRS <- synthetic_cdisc_data("latest")$adrs # nolint: object_name_linter.
rADRS <- random.cdisc.data::cadrs # nolint: object_name_linter.
usethis::use_data(rADRS)

rADSL <- synthetic_cdisc_data("latest")$adsl # nolint: object_name_linter.
rADSL <- random.cdisc.data::cadsl # nolint: object_name_linter.
usethis::use_data(rADSL)

rADTR <- synthetic_cdisc_data("latest")$adtr # nolint: object_name_linter.
rADTR <- random.cdisc.data::cadtr # nolint: object_name_linter.
usethis::use_data(rADTR)

rADTTE <- synthetic_cdisc_data("latest")$adtte # nolint: object_name_linter.
rADTTE <- random.cdisc.data::cadtte # nolint: object_name_linter.
usethis::use_data(rADTTE)

rADVS <- synthetic_cdisc_data("latest")$advs # nolint: object_name_linter.
rADVS <- random.cdisc.data::cadvs # nolint: object_name_linter.
usethis::use_data(rADVS)

## Code to prepare default CDISC datasets for `teal.data`
Expand Down
Binary file modified data/rADAE.rda
Binary file not shown.
Binary file modified data/rADCM.rda
Binary file not shown.
Binary file modified data/rADEX.rda
Binary file not shown.
Binary file modified data/rADLB.rda
Binary file not shown.
Binary file modified data/rADRS.rda
Binary file not shown.
Binary file modified data/rADSL.rda
Binary file not shown.
Binary file modified data/rADTR.rda
Binary file not shown.
Binary file modified data/rADTTE.rda
Binary file not shown.
Binary file modified data/rADVS.rda
Binary file not shown.
12 changes: 6 additions & 6 deletions tests/testthat/test-get_code.R
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ testthat::test_that("understands @ usage and do not treat rhs of @ as objects (o
testthat::test_that("library() and require() are always returned", {
code <- c(
"set.seed(1)",
"library(scda)",
"library(random.cdisc.data)",
"require(dplyr)",
"library(MultiAssayExperiment)",
"x <- 5",
Expand All @@ -648,7 +648,7 @@ testthat::test_that("library() and require() are always returned", {
get_code(tdata, datanames = "x"),
paste(
warning_message,
"library(scda)",
"library(random.cdisc.data)",
"require(dplyr)",
"library(MultiAssayExperiment)",
"x <- 5",
Expand All @@ -663,7 +663,7 @@ testthat::test_that("library() and require() are always returned", {
testthat::test_that("data() call is returned when data name is provided as is", {
code <- c(
"set.seed(1)",
"library(scda)",
"library(random.cdisc.data)",
"require(dplyr)",
"library(MultiAssayExperiment)",
"data(miniACC, envir = environment())",
Expand All @@ -674,7 +674,7 @@ testthat::test_that("data() call is returned when data name is provided as is",
get_code(tdata, datanames = "x"),
paste(
warning_message,
"library(scda)",
"library(random.cdisc.data)",
"require(dplyr)",
"library(MultiAssayExperiment)",
"data(miniACC, envir = environment())",
Expand All @@ -687,7 +687,7 @@ testthat::test_that("data() call is returned when data name is provided as is",
testthat::test_that("data() call is returned when data name is provided as a character", {
code <- c(
"set.seed(1)",
"library(scda)",
"library(random.cdisc.data)",
"require(dplyr)",
"library(MultiAssayExperiment)",
"data('mtcars')",
Expand All @@ -698,7 +698,7 @@ testthat::test_that("data() call is returned when data name is provided as a cha
get_code(tdata, datanames = "z"),
paste(
warning_message,
"library(scda)",
"library(random.cdisc.data)",
"require(dplyr)",
"library(MultiAssayExperiment)",
"data(\"mtcars\")",
Expand Down

0 comments on commit 5f0a429

Please sign in to comment.