Skip to content

Commit 46c8e85

Browse files
committed
resolve conflict
2 parents 85b053c + 3c5c647 commit 46c8e85

File tree

10 files changed

+108
-29
lines changed

10 files changed

+108
-29
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# R specific hooks: https://github.com/lorenzwalthert/precommit
44
repos:
55
- repo: https://github.com/lorenzwalthert/precommit
6-
rev: v0.4.3.9005
6+
rev: v0.4.3.9017
77
hooks:
88
- id: style-files
99
args: [--style_pkg=styler, --style_fun=tidyverse_style]
@@ -51,7 +51,7 @@ repos:
5151
hooks:
5252
- id: prettier
5353
- repo: https://github.com/pre-commit/pre-commit-hooks
54-
rev: v5.0.0
54+
rev: v6.0.0
5555
hooks:
5656
- id: check-added-large-files
5757
args: ["--maxkb=200"]
@@ -77,6 +77,6 @@ repos:
7777
files: '\.Rhistory|\.RData|\.Rds|\.rds$'
7878
# `exclude: <regex>` to allow committing specific files.
7979
- repo: https://github.com/igorshubovych/markdownlint-cli
80-
rev: v0.44.0
80+
rev: v0.47.0
8181
hooks:
8282
- id: markdownlint

DESCRIPTION

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
Type: Package
22
Package: scda.test
33
Title: Template Tests
4-
Version: 0.0.0.9097
5-
Date: 2025-03-11
4+
Version: 0.0.0.9103
5+
Date: 2025-12-25
66
Authors@R: c(
77
person("Joe", "Zhu", , "[email protected]", role = c("aut", "cre")),
8-
person("Daniel", "Sabanés Bové", , "daniel.sabanes_bove@roche.com", role = "aut"),
9-
person("Jana", "Stoilova", , "jana.stoilova@roche.com", role = "aut"),
10-
person("Heng", "Wang", , "wang.heng@gene.com", role = "aut"),
8+
person("Daniel", "Sabanés Bové", , "daniel.sabanes_bove@rconis.com", role = "aut"),
9+
person("Jana", "Stoilova", , "stoilova@dnli.com", role = "aut"),
10+
person("Heng", "Wang", , "Heng.Wang21@gilead.com", role = "aut"),
1111
person("Francois", "Collin", role = "aut"),
12-
person("Adrian", "Waddell", , "adrian.waddell@gene.com", role = "aut"),
12+
person("Adrian", "Waddell", , "aadrian.waddell@gmail.com", role = "aut"),
1313
person("Pawel", "Rucki", , "[email protected]", role = "aut"),
14-
person("Chendi", "Liao", , "[email protected]", role = "aut"),
15-
person("Jennifer", "Li", , "[email protected]", role = "aut"),
14+
person("Chendi", "Liao", role = "aut"),
15+
person("Jennifer", "Li", role = "aut"),
1616
person("F. Hoffmann-La Roche AG", role = c("cph", "fnd"))
1717
)
1818
Description: Tests of sample templates from TLG Catalog using data from
@@ -21,13 +21,13 @@ License: Apache License 2.0 | file LICENSE
2121
URL: https://github.com/insightsengineering/scda.test/
2222
BugReports: https://github.com/insightsengineering/scda.test/issues
2323
Depends:
24-
formatters (>= 0.5.10.9001),
24+
formatters (>= 0.5.12),
2525
R (>= 4.2),
26-
rlistings (>= 0.2.10),
27-
rtables (>= 0.6.11.9017),
28-
tern (>= 0.9.7.9018)
26+
rlistings (>= 0.2.13),
27+
rtables (>= 0.6.15),
28+
tern (>= 0.9.10)
2929
Imports:
30-
pharmaverseadam (>= 1.1.0),
30+
pharmaverseadam (>= 1.1.0.9001),
3131
random.cdisc.data (>= 0.3.16)
3232
Suggests:
3333
broom,
@@ -46,6 +46,7 @@ VignetteBuilder:
4646
knitr
4747
Remotes:
4848
insightsengineering/formatters@main,
49+
insightsengineering/rlistings@main,
4950
insightsengineering/rtables@main,
5051
insightsengineering/tern@main,
5152
pharmaverse/pharmaverseadam@main
@@ -56,4 +57,4 @@ Encoding: UTF-8
5657
Language: en-US
5758
LazyData: true
5859
Roxygen: list(markdown = TRUE)
59-
RoxygenNote: 7.3.2
60+
RoxygenNote: 7.3.3

NEWS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# scda.test 0.0.0.9097
1+
# scda.test 0.0.0.9103
22

33
### New Features
44
* Added table tests from `tern`.

man/scda.test-package.Rd

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/_snaps/listing_egl01.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
88
——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
99
Heart Rate Result QT Duration Result RR Duration Result
10-
Study (BEATS/MIN); Heart Rate (msec); QT Duration (msec); RR Duration
10+
Study (beats/min); Heart Rate (ms); QT Duration (ms); RR Duration
1111
Treatment Center/Subject ID Age/Sex/Race Visit Day Range:(40-100) Change from BL Range:(350-450) Change from BL Range:(600-1500) Change from BL
1212
——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
1313
Placebo 701/1015 63/F/WHITE Baseline 1 73.67 NA 456.67/H NA 519.00/L NA
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# DMT01 variant factor with only Missing values
2+
3+
Code
4+
res
5+
Output
6+
Placebo Screen Failure Xanomeline High Dose Xanomeline Low Dose
7+
(N=86) (N=52) (N=72) (N=96)
8+
——————————————————————————————————————————————————————————————————————————————————————————————————
9+
Age (yr)
10+
n 86 52 72 96
11+
Mean (SD) 75.2 (8.6) 75.1 (9.7) 73.8 (7.9) 76.0 (8.1)
12+
Median 76.0 76.0 75.5 78.0
13+
Min - Max 52.0 - 89.0 50.0 - 89.0 56.0 - 88.0 51.0 - 88.0
14+
Age Group
15+
n 86 52 72 96
16+
18-40 0 0 0 0
17+
41-64 14 (16.3%) 9 (17.3%) 11 (15.3%) 8 (8.3%)
18+
>=65 72 (83.7%) 43 (82.7%) 61 (84.7%) 88 (91.7%)
19+
Biomarker 1 Categories
20+
n 0 0 0 0
21+

tests/testthat/setup.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,8 @@ advs_raw <- random.cdisc.data::cadvs
190190
# Data loading for pharmaverse
191191

192192
adpp_pharmaverse <- pharmaverseadam::adpp
193-
adpc_pharmaverse <- pharmaverseadam::adpc
193+
adpc_pharmaverse <- pharmaverseadam::adpc %>%
194+
filter(!is.na(AVAL))
194195

195196
set.seed(99)
196197

tests/testthat/test-table_disclosures.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ adsl_local <- local({
3434

3535
adsl_f$AGEGRP <- factor(adsl_f$AGEGRP, levels = c("< 65 yrs", ">= 65 yrs"))
3636
adsl_f$ETHNIC <- factor(adsl_f$ETHNIC, levels = c("Ethnicity 1", "Ethnicity 2", "Unknown"))
37+
# adsl_f <- df_explicit_na(adsl_f)
3738
# nolint end
38-
adsl_f <- df_explicit_na(adsl_f)
3939
adsl_f
4040
})
4141

tests/testthat/test-table_dtht01.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ testthat::test_that("DTHT01 variant 4 is produced correctly", {
112112
mutate(
113113
DTHCAUS_other = factor(ifelse(
114114
DTHCAT == "OTHER" & DTHCAUS != "Post-study reporting of death", as.character(DTHCAUS), NA
115-
), levels = c("LOST TO FOLLOW UP", "SUICIDE", "UNKNOWN", "MISSING")) %>% explicit_na()
115+
), levels = c("LOST TO FOLLOW UP", "SUICIDE", "UNKNOWN", "MISSING")) %>% explicit_na(label = "<Missing>")
116116
)
117117

118118
lyt <- basic_table(show_colcounts = TRUE) %>%
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# extra special case situation to scenario from test-table_dmt01.R
2+
# Tests DMT01 with corner case situation to demonstrate bug in analyze is resolved with empty factor data
3+
# tern@1431-bug-s_summaryfactor
4+
set.seed(1)
5+
6+
adsl <- pharmaverseadam::adsl
7+
adsl <- adsl %>%
8+
mutate(BMRKR1 = rnorm(nrow(adsl), 3.5, 10)) %>%
9+
mutate(STRATA1 = factor(sample(c("A", "B", "C"), nrow(adsl), TRUE)))
10+
11+
adsl <- df_explicit_na(adsl)
12+
13+
adsl <- adsl %>%
14+
mutate(
15+
SEX = factor(case_when(
16+
SEX == "M" ~ "Male",
17+
SEX == "F" ~ "Female",
18+
SEX == "U" ~ "Unknown",
19+
SEX == "UNDIFFERENTIATED" ~ "Undifferentiated"
20+
)),
21+
AGEGR1 = factor(
22+
case_when(
23+
between(AGE, 18, 40) ~ "18-40",
24+
between(AGE, 41, 64) ~ "41-64",
25+
AGE > 64 ~ ">=65"
26+
),
27+
levels = c("18-40", "41-64", ">=65")
28+
),
29+
BMRKR1_CAT = NA_character_
30+
) %>%
31+
var_relabel(
32+
BMRKR1_CAT = "Biomarker 1 Categories"
33+
)
34+
35+
adsl <- df_explicit_na(adsl, na_level = "<Missing>")
36+
37+
38+
testthat::test_that("DMT01 variant factor with only Missing values", {
39+
vars <- c("AGE", "AGEGR1", "BMRKR1_CAT")
40+
var_labels <- c(
41+
"Age (yr)",
42+
"Age Group",
43+
"Biomarker 1 Categories"
44+
)
45+
46+
result <- basic_table(show_colcounts = TRUE) %>%
47+
split_cols_by(var = "ACTARM") %>%
48+
analyze_vars(
49+
vars = vars,
50+
var_labels = var_labels
51+
) %>%
52+
build_table(adsl)
53+
54+
res <- testthat::expect_silent(result)
55+
testthat::expect_snapshot(res)
56+
})

0 commit comments

Comments
 (0)