Skip to content

Commit

Permalink
removing depends on
Browse files Browse the repository at this point in the history
  • Loading branch information
Melkiades committed Apr 3, 2024
1 parent 7662d42 commit b56f9a0
Show file tree
Hide file tree
Showing 39 changed files with 80 additions and 80 deletions.
8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ License: Apache License 2.0 | file LICENSE
URL: https://github.com/insightsengineering/scda.test/
BugReports: https://github.com/insightsengineering/scda.test/issues
Depends:
formatters (>= 0.5.5),
formatters (>= 0.5.5.9018),
R (>= 4.2),
rlistings (>= 0.2.7),
rtables (>= 0.6.6),
tern (>= 0.9.3)
rlistings (>= 0.2.7.9011),
rtables (>= 0.6.6.9011),
tern (>= 0.9.3.9028)
Imports:
pharmaverseadam (>= 0.2.0),
random.cdisc.data (>= 0.3.14.9006)
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-listing_adal02.R
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ testthat::test_that("ADAL02 listing is produced correctly", {
) %>%
select(USUBJID, unique(adab_x$VISN[order(adab_x$NFRLT)]), PTES)

formatters::var_labels(out) <- names(out)
var_labels(out) <- names(out)

out <- out %>%
formatters::var_relabel(
var_relabel(
USUBJID = "Subject ID",
PTES = "Patient Treatment\nEmergent ADA Status"
)
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-listing_ael01.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ testthat::test_that("AEL01 listing is produced correctly", {
select(AESOC, AEDECOD, AELLT, AETERM) %>%
unique()

formatters::var_labels(out) <- c(
var_labels(out) <- c(
AESOC = "MedDRA System Organ Class",
AEDECOD = "MedDRA Preferred Term",
AELLT = "MedDRA Lowest Level Term",
Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test-listing_ael01_nollt.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ testthat::test_that("AEL01_NOLLT listing is produced correctly", {
select(AESOC, AEDECOD, AETERM) %>%
unique()

formatters::var_labels(out) <- c(
var_labels(out) <- c(
AESOC = "MedDRA System Organ Class",
AEDECOD = "MedDRA Preferred Term",
AETERM = "Investigator-Specified\nAdverse Event Term"
Expand All @@ -14,8 +14,8 @@ testthat::test_that("AEL01_NOLLT listing is produced correctly", {
key_cols = c("AESOC", "AEDECOD"),
disp_cols = names(out),
default_formatting = list(
all = formatters::fmt_config(align = "left"),
numeric = formatters::fmt_config(align = "center")
all = fmt_config(align = "left"),
numeric = fmt_config(align = "center")
),
main_title = "Listing of Preferred Terms and Investigator-Specified Adverse Event Terms"
) %>% head(50), "sorting incoming data by key columns")
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-listing_ael02.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ testthat::test_that("AEL02 listing is produced correctly", {
) %>%
select(CPID, ASR, TRT01A, AEDECOD, Date_First, ASTDY, Duration, Serious, AESEV, Related, Outcome, Treated, Action)

formatters::var_labels(out) <- c(
var_labels(out) <- c(
CPID = "Center/Patient ID",
ASR = "Age/Sex/Race",
TRT01A = "Treatment",
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-listing_ael02_ed.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ testthat::test_that("AEL02_ED listing is produced correctly", {
ADURN, AESER_F, AESEV, AEREL_F, AEOUT_F, AECONTRT_F, AEACN_F
)

formatters::var_labels(out) <- c(
var_labels(out) <- c(
cent_subj = "Center/Patient ID",
ASR = "Age/Sex/Race",
TRT01A = "Treatment",
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-listing_ael03.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ testthat::test_that("AEL03 listing is produced correctly", {
) %>%
select(CPID, ASR, TRT01A, AEDECOD, Date_First, ASTDY, Duration, AESEV, Related, Outcome, Treated, Action, SERREAS)

formatters::var_labels(out) <- c(
var_labels(out) <- c(
CPID = "Center/Patient ID",
ASR = "Age/Sex/Race",
TRT01A = "Treatment",
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-listing_ael04.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ testthat::test_that("AEL04 listing is produced correctly", {
arrange(SUBJID) %>%
select(ID, AGSXRC, TRT01A, TRTSD, EOSDY, DTHADY, DTHCAUS, ADTHAUT)

formatters::var_labels(out) <- c(
var_labels(out) <- c(
ID = "Center/Patient ID",
AGSXRC = "Age/Sex/Race",
TRT01A = "Treatment",
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-listing_cml01.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ testthat::test_that("CML01 listing is produced correctly", {
CMSTRFL, CMENRFL, CMDOSE, CMDOSU, CMDOSFRQ, CMROUTE
)

formatters::var_labels(out) <- c(
var_labels(out) <- c(
ID = "Center/Patient ID",
AGSXRC = "Age/Sex/Race",
TRT01A = "Treatment",
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-listing_cml02a_gl.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ testthat::test_that("CML02A_GL listing is produced correctly", {
select(ATC2, CMDECOD, CMTRT) %>%
unique()

formatters::var_labels(out) <- c(
var_labels(out) <- c(
ATC2 = "ATC Class Level 2",
CMDECOD = "WHODrug Preferred Name",
CMTRT = "Investigator-Specified\nTreatment Term"
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-listing_cml02b_gl.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ testthat::test_that("CML02B_GL listing is produced correctly", {
select(ATC1, ATC2, ATC3, ATC4, CMDECOD, CMTRT) %>%
unique()

formatters::var_labels(out) <- c(
var_labels(out) <- c(
ATC1 = "ATC Class Level 1",
ATC2 = "ATC Class Level 2",
ATC3 = "ATC Class Level 3",
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-listing_dsl01.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ testthat::test_that("DSL01 listing is produced correctly", {
) %>%
select(ID, ASR, ARMCD, SSADM, STDWD, DISCONT)

formatters::var_labels(out) <- c(
var_labels(out) <- c(
ID = "Center/Patient ID",
ASR = "Age/Sex/Race",
ARMCD = "Treatment",
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-listing_dsl02.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ testthat::test_that("DSL02 listing is produced correctly", {
filter(DISCONT == "Yes") %>%
select(ID, ASR, TRT01A, SSADTM, EOSDY, SSAEDY, RANDEDY, DCSREAS)

formatters::var_labels(out) <- c(
var_labels(out) <- c(
ID = "Center/Patient ID",
ASR = "Age/Sex/Race",
TRT01A = "Treatment",
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-listing_dsur4.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ testthat::test_that("DSUR4 listing is produced correctly", {
select(ARM, ID, DTHCAUS)
death_num <- length(unique(out$ID))

formatters::var_labels(out) <- c(
var_labels(out) <- c(
ARM = "Treatment Group",
ID = "Center/Patient ID",
DTHCAUS = "Cause of Death"
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-listing_egl01.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ testthat::test_that("EGL01 listing is produced correctly", {
select(
CRTNPT, AGSXRC, TRT01A, AVISIT, ADY, AVAL_ANRIND_HR, CHG_HR, AVAL_ANRIND_QT, CHG_QT, AVAL_ANRIND_RR, CHG_RR
) %>%
formatters::var_relabel(
var_relabel(
CRTNPT = "Center/Subject ID",
AGSXRC = "Age/Sex/Race",
TRT01A = "Treatment",
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-listing_exl01.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ testthat::test_that("EXL01 listing is produced correctly", {
arrange(CRTNPT, AVISIT) %>%
select(CRTNPT, AVISIT, EXSTDY, EXENDY, TRT01A, AVAL, AVALU, EXDOSFRQ, EXROUTE)

formatters::var_labels(out) <- c(
var_labels(out) <- c(
CRTNPT = "Center/Subject ID",
AVISIT = "Visit",
EXSTDY = "Study Day\nFrom",
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-listing_lbl01.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ testthat::test_that("LBL01 listing is produced correctly", {
ungroup() %>%
select(CPID, TRT01A, ADY, DLD, unique(adlb_x$PARAM_U))

formatters::var_labels(out) <- names(out)
out <- out %>% formatters::var_relabel(
var_labels(out) <- names(out)
out <- out %>% var_relabel(
TRT01A = "Treatment",
CPID = "Center/Patient ID",
ADY = "Study\nDay",
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-listing_lbl01_rls.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ testthat::test_that("LBL01_RLS listing is produced correctly", {
ungroup() %>%
select(CPID, TRT01A, ADY, DLD, unique(adlb_x$PARAM_U))

formatters::var_labels(out) <- names(out)
out <- out %>% formatters::var_relabel(
var_labels(out) <- names(out)
out <- out %>% var_relabel(
TRT01A = "Treatment",
CPID = "Center/Patient ID",
ADY = "Study\nDay",
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-listing_lbl02a.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ testthat::test_that("LBL02A listing is produced correctly", {
out <- adlb_x %>%
select(LBTEST_U, TRT01A, CPID, ADY, ADTM, DLD, AVAL, LBNRNG, ANRIND_GR)

formatters::var_labels(out) <- names(out)
out <- out %>% formatters::var_relabel(
var_labels(out) <- names(out)
out <- out %>% var_relabel(
LBTEST_U = "Lab Test (Unit)",
TRT01A = "Treatment",
CPID = "Center/Patient ID",
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-listing_lbl02a_rls.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ testthat::test_that("LBL02A_RLS listing is produced correctly", {
out <- adlb_x %>%
select(LBTEST_U, TRT01A, CPID, ADY, DLD, AVAL, PCHG, STD_RNG, LBNRNG, CRC, ANRIND)

formatters::var_labels(out) <- names(out)
var_labels(out) <- names(out)
out <- out %>%
formatters::var_relabel(
var_relabel(
LBTEST_U = "Lab Test (Unit)",
TRT01A = "Treatment",
CPID = "Center/Patient ID",
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-listing_lbl02b.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ testthat::test_that("LBL02B listing is produced correctly", {
out <- adlb_x %>%
select(LBTEST, TRT01A, CPID, ADY, ADTM, DLD, AVAL, AVALU, LBNRNG, ANRIND_GR)

formatters::var_labels(out) <- names(out)
var_labels(out) <- names(out)
out <- out %>%
formatters::var_relabel(
var_relabel(
LBTEST = "Lab Test",
TRT01A = "Treatment",
CPID = "Center/Patient ID",
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-listing_mhl01.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ testthat::test_that("MHL01 listing is produced correctly", {
) %>%
select(ID, ASR, TRT01A, MHBODSYS, MHDECOD, TRTSDTM, ASTDTM, ASTDY, AENDTM, AENDY, ATIREL)

formatters::var_labels(out) <- c(
var_labels(out) <- c(
ID = "Center/Patient ID",
ASR = "Age/Sex/Race",
TRT01A = "Treatment",
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-listing_pkcl01.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ testthat::test_that("PKCL01 listing is produced correctly", {
filter(PARAM == analyte) %>%
select(ARM, USUBJID, VISIT, NFRLT, AFRLT, AVAL)

formatters::var_labels(out) <- c(
var_labels(out) <- c(
ARM = "Treatment Group",
USUBJID = "Subject ID",
VISIT = "Visit",
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-listing_pkcl02.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ testthat::test_that("PKCL02 listing is produced correctly", {
values_from = VALUE
)

formatters::var_labels(out) <- names(out)
out <- out %>% formatters::var_relabel(
var_labels(out) <- names(out)
out <- out %>% var_relabel(
TRT01A = "Treatment Group",
USUBJID = "Subject ID",
VISIT = "Visit"
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-listing_pkpl01.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ testthat::test_that("PKPL01 listing is produced correctly", {
values_from = AVAL
)

formatters::var_labels(out) <- names(out)
out <- out %>% formatters::var_relabel(
var_labels(out) <- names(out)
out <- out %>% var_relabel(
TRT01A = "Treatment Group",
USUBJID = "Subject ID",
AVISIT = "Visit"
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-listing_pkpl02.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ testthat::test_that("PKPL02 listing is produced correctly", {
values_from = AVAL
)

formatters::var_labels(out) <- names(out)
out <- out %>% formatters::var_relabel(
var_labels(out) <- names(out)
out <- out %>% var_relabel(
TRT01A = "Treatment Group",
USUBJID = "Subject ID",
AVISIT = "Visit"
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-listing_pkpl04.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ testthat::test_that("PKPL04 listing is produced correctly", {
) %>%
select(names(.)[c(1:2, 4, 6, 3, 5, 7)])

formatters::var_labels(out) <- names(out)
out <- out %>% formatters::var_relabel(USUBJID = "Subject ID")
var_labels(out) <- names(out)
out <- out %>% var_relabel(USUBJID = "Subject ID")

testthat::expect_message(result <- as_listing(
out,
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-listing_vsl01.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ testthat::test_that("VSL01 listing is produced correctly", {
AVAL_ANRIND_DIABP, CHG_DIABP, AVAL_ANRIND_SYSBP, CHG_SYSBP, AVAL_ANRIND_PULSE, CHG_PULSE,
AVAL_ANRIND_RESP, CHG_RESP
) %>%
formatters::var_relabel(
var_relabel(
CRTNPT = "Center/Subject ID",
AGSXRC = "Age/Sex/Race",
TRT01A = "Treatment",
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-pagination_listing.R
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ result <- adae_raw %>%
select(CPID, ASR, TRT01A, AEDECOD, Date_First, ASTDY, Duration, AESEV, Related, Outcome, Treated, Action, SERREAS)

# Adding labels
formatters::var_labels(result) <- c(
var_labels(result) <- c(
CPID = "Center/Patient ID",
ASR = "Age/Sex/Race",
TRT01A = "Treatment",
Expand Down Expand Up @@ -79,7 +79,7 @@ lst_res <- as_listing(
testthat::test_that("Direct pagination works fine", {
testthat::expect_equal(nrow(lst_res), 50) # head() worked

clw <- formatters::propose_column_widths(lst_res) / 2 + 1
clw <- propose_column_widths(lst_res) / 2 + 1

pg_lst <- testthat::expect_silent(paginate_listing(lst_res, lpp = 50, colwidths = floor(clw)))
testthat::expect_equal(length(pg_lst), 10L)
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-pagination_table.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ testthat::test_that("Direct pagination with standard values", {

testthat::test_that("Pagination with specific column widths and minimum lines per page", {
# With combo of rows and cols per page
std_col_widths <- formatters::propose_column_widths(raw_result)
std_col_widths <- propose_column_widths(raw_result)
# Min h-width: first value is the row label, second is the largest content, 3 is the inter-space
cpp_width <- std_col_widths[1] + max(std_col_widths[-1]) + 3
pag_res <- testthat::expect_silent(
Expand Down Expand Up @@ -211,7 +211,7 @@ testthat::test_that("AET04 variant 2 page_by pagination tests", {
res <- testthat::expect_silent(result)
pag_res <- testthat::expect_silent(paginate_table(res))
testthat::expect_setequal(
sapply(pag_res, formatters::page_titles),
sapply(pag_res, page_titles),
paste0("AEBODSYS: ", levels(adae$AEBODSYS))
)
testthat::expect_snapshot(pag_res[c(2, 5)]) # randomly picked to have a comparison
Expand Down
14 changes: 7 additions & 7 deletions tests/testthat/test-table_aet06_smq.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ adsl <- adsl_pharmaverse
adae <- adae_pharmaverse

testthat::test_that("AET06_SMQ variant 1 is produced correctly", {
adsl_labels <- formatters::var_labels(adsl)
adae_labels <- formatters::var_labels(adae)
adsl_labels <- var_labels(adsl)
adae_labels <- var_labels(adae)

adae <- adae %>%
dplyr::mutate(
Expand Down Expand Up @@ -39,7 +39,7 @@ testthat::test_that("AET06_SMQ variant 1 is produced correctly", {

adae_f <- rbind(adae_smq1, adae_smq2, adae_smq3)

formatters::var_labels(adae_f) <- c(adae_labels, "SMQ" = "Standardised MedDRA Queries")
var_labels(adae_f) <- c(adae_labels, "SMQ" = "Standardised MedDRA Queries")

lyt <- basic_table() %>%
split_cols_by("ARM") %>%
Expand Down Expand Up @@ -74,8 +74,8 @@ testthat::test_that("AET06_SMQ variant 1 is produced correctly", {
})

testthat::test_that("AET06_SMQ variant 2 is produced correctly", {
adsl_labels <- formatters::var_labels(adsl)
adae_labels <- formatters::var_labels(adae)
adsl_labels <- var_labels(adsl)
adae_labels <- var_labels(adae)

adsl <- adsl %>%
dplyr::mutate(
Expand All @@ -86,7 +86,7 @@ testthat::test_that("AET06_SMQ variant 2 is produced correctly", {
AGE65 = factor(AGE65, levels = c(">= 65", "< 65"))
)

formatters::var_labels(adsl) <- c(adsl_labels, "AGE65" = "AGE65 GROUP")
var_labels(adsl) <- c(adsl_labels, "AGE65" = "AGE65 GROUP")

adae <- adae %>%
dplyr::mutate(
Expand Down Expand Up @@ -126,7 +126,7 @@ testthat::test_that("AET06_SMQ variant 2 is produced correctly", {

adae_f <- rbind(adae_smq1, adae_smq2, adae_smq3)

formatters::var_labels(adae_f) <- c(adae_labels, "SMQ" = "Standardised MedDRA Queries", "AGE65" = "AGE65 GROUP")
var_labels(adae_f) <- c(adae_labels, "SMQ" = "Standardised MedDRA Queries", "AGE65" = "AGE65 GROUP")

lyt <- basic_table() %>%
split_cols_by("ARM") %>%
Expand Down
Loading

0 comments on commit b56f9a0

Please sign in to comment.