Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

phase out of scda and intro of {pharmaverseadam} #75

Merged
merged 14 commits into from
Dec 13, 2023
5 changes: 2 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Authors@R: c(
person("F. Hoffmann-La Roche AG", role = c("cph", "fnd"))
)
Description: Tests of sample templates from TLG Catalog using data from
the scda package.
`random.cdisc.data` package.
Melkiades marked this conversation as resolved.
Show resolved Hide resolved
License: Apache License 2.0 | file LICENSE
URL: https://github.com/insightsengineering/scda.test/
BugReports: https://github.com/insightsengineering/scda.test/issues
Expand All @@ -27,8 +27,7 @@ Depends:
rtables (>= 0.6.5.9004),
tern (>= 0.9.2.9001)
Imports:
scda (>= 0.1.6.9012),
scda.2022 (>= 0.1.5.9002)
random.cdisc.data (>= 0.3.14.9002)
Suggests:
broom,
checkmate,
Expand Down
3 changes: 1 addition & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Generated by roxygen2: do not edit by hand

import(formatters)
import(random.cdisc.data)
Melkiades marked this conversation as resolved.
Show resolved Hide resolved
import(rtables)
import(scda)
import(scda.2022)
import(tern)
importFrom(rlistings,as_listing)
2 changes: 1 addition & 1 deletion R/scda.test.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@


# Fix R CMD check notes
#' @import formatters rtables tern scda scda.2022
#' @import formatters rtables tern random.cdisc.data
Melkiades marked this conversation as resolved.
Show resolved Hide resolved
#' @importFrom rlistings as_listing
NULL
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# scda.test

Internal repository to store tests that utilize datasets from the `scda` package. Repository tests TLG sample templates to verify functionality and correct output. Template tests were migrated here from the `tern` package in February 2023.
Internal repository to store tests that utilize datasets from the `random.cdisc.data` package. Repository tests TLG sample templates to verify functionality and correct output. Template tests were migrated here from the `tern` package in February 2023.

## Installation

### Installing Package Dependencies

The `scda.test` package has several dependencies required to run the tests within this package. Before installing the `scda.test` repository, please ensure you have the latest versions of the `tern`, `scda`, and `scda.2022` packages installed. Installation instructions are provided for each at these links:
The `scda.test` package has several dependencies required to run the tests within this package. Before installing the `scda.test` repository, please ensure you have the latest versions of the `tern` and `random.cdisc.data` packages installed. Installation instructions are provided for each at these links:

- [`tern`](https://github.com/insightsengineering/tern#installation)
- [`scda`](https://github.com/insightsengineering/scda#installation)
- [`scda.2022`](https://github.com/insightsengineering/scda.2022#installation)
- [`random.cdisc.data`](https://github.com/insightsengineering/random.cdisc.data#installation)

### Installing scda.test

Expand Down
7 changes: 2 additions & 5 deletions staged_dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@ upstream_repos:
insightsengineering/rtables:
repo: insightsengineering/rtables
host: https://github.com
insightsengineering/scda:
repo: insightsengineering/scda
host: https://github.com
insightsengineering/scda.2022:
repo: insightsengineering/scda.2022
insightsengineering/random.cdisc.data:
repo: insightsengineering/random.cdisc.data
host: https://github.com
insightsengineering/tern:
repo: insightsengineering/tern
Expand Down
325 changes: 153 additions & 172 deletions tests/testthat/_snaps/table_dmt01.md

Large diffs are not rendered by default.

39 changes: 19 additions & 20 deletions tests/testthat/setup.R
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
# Extra libraries (suggested) for tests
library(dplyr)
library(scda.2022)
library(tern)
library(lubridate)

# Data loading for tests
adsl_raw <- scda::synthetic_cdisc_dataset("latest", "adsl")
adab_raw <- scda::synthetic_cdisc_dataset("latest", "adab")
adae_raw <- scda::synthetic_cdisc_dataset("latest", "adae")
adaette_raw <- scda::synthetic_cdisc_dataset("latest", "adaette")
adcm_raw <- scda::synthetic_cdisc_dataset("latest", "adcm")
addv_raw <- scda::synthetic_cdisc_dataset("latest", "addv")
adeg_raw <- scda::synthetic_cdisc_dataset("latest", "adeg")
adex_raw <- scda::synthetic_cdisc_dataset("latest", "adex")
adhy_raw <- scda::synthetic_cdisc_dataset("latest", "adhy")
adlb_raw <- scda::synthetic_cdisc_dataset("latest", "adlb")
admh_raw <- scda::synthetic_cdisc_dataset("latest", "admh")
adpc_raw <- scda::synthetic_cdisc_dataset("latest", "adpc")
adpp_raw <- scda::synthetic_cdisc_dataset("latest", "adpp")
adpc_raw <- scda::synthetic_cdisc_dataset("latest", "adpc")
adqs_raw <- scda::synthetic_cdisc_dataset("latest", "adqs")
adrs_raw <- scda::synthetic_cdisc_dataset("latest", "adrs")
adsub_raw <- scda::synthetic_cdisc_dataset("latest", "adsub")
adtte_raw <- scda::synthetic_cdisc_dataset("latest", "adtte")
advs_raw <- scda::synthetic_cdisc_dataset("latest", "advs")
adsl_raw <- random.cdisc.data::cadsl
adab_raw <- random.cdisc.data::cadab
adae_raw <- random.cdisc.data::cadae
adaette_raw <- random.cdisc.data::cadaette
adcm_raw <- random.cdisc.data::cadcm
addv_raw <- random.cdisc.data::caddv
adeg_raw <- random.cdisc.data::cadeg
adex_raw <- random.cdisc.data::cadex
adhy_raw <- random.cdisc.data::cadhy
adlb_raw <- random.cdisc.data::cadlb
admh_raw <- random.cdisc.data::cadmh
adpc_raw <- random.cdisc.data::cadpc
adpp_raw <- random.cdisc.data::cadpp
adpc_raw <- random.cdisc.data::cadpc
adqs_raw <- random.cdisc.data::cadqs
adrs_raw <- random.cdisc.data::cadrs
adsub_raw <- random.cdisc.data::cadsub
adtte_raw <- random.cdisc.data::cadtte
advs_raw <- random.cdisc.data::cadvs

# skip_if_too_deep
skip_if_too_deep <- function(depth) { # nolintr
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-table_aet01_aesi.R
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ testthat::test_that("AET01_AESI Variant 2 works as expected", {
})

testthat::test_that("AET01_AESI Variant 3 works as expected", {
adsl <- synthetic_cdisc_dataset("latest", "adsl")
adae_mult <- synthetic_cdisc_dataset("latest", "adae")
adsl <- adsl_raw
adae_mult <- adae_raw

adsl <- filter(adsl, SAFFL == "Y")
adae_mult <- filter(adae_mult, ANL01FL == "Y" & SAFFL == "Y")
Expand Down
11 changes: 8 additions & 3 deletions tests/testthat/test-table_dmt01.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# Tests DMT01
set.seed(1)

adsl <- adsl_raw
advs <- advs_raw
# adsl <- adsl_raw
adsl <- pharmaverseadam::adsl
shajoezhu marked this conversation as resolved.
Show resolved Hide resolved
adsl <- adsl %>%
mutate(BMRKR1 = rnorm(nrow(adsl), 3.5, 10))
advs <- pharmaverseadam::advs
adsub <- adsub_raw
# adsub <- pharmaverseadam::adsub # ??

adsl <- df_explicit_na(adsl)
advs <- df_explicit_na(advs)
Expand Down Expand Up @@ -118,7 +123,7 @@ testthat::test_that("DMT01 variant 3 is produced correctly", {
vars = c("AGE", "SEX", "RACE"),
var_labels = c("Age", "Sex", "Race")
) %>%
split_rows_by("STRATA1",
split_rows_by("ACTARMCD",
split_fun = split_fun
) %>%
analyze_vars("BMRKR1") %>%
Expand Down
Loading