Skip to content

Commit

Permalink
Merge branch 'main' into 1069_lt10_format@main
Browse files Browse the repository at this point in the history
  • Loading branch information
edelarua authored Oct 5, 2023
2 parents 74dbd3f + 0861b91 commit 4f77c6c
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 30 deletions.
8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: tern
Title: Create Common TLGs Used in Clinical Trials
Version: 0.9.0.9008
Date: 2023-10-02
Version: 0.9.1.9000
Date: 2023-10-04
Authors@R: c(
person("Joe", "Zhu", , "[email protected]", role = c("aut", "cre")),
person("Daniel", "Sabanés Bové", , "[email protected]", role = "aut"),
Expand All @@ -21,7 +21,7 @@ URL: https://github.com/insightsengineering/tern
BugReports: https://github.com/insightsengineering/tern/issues
Depends:
R (>= 3.6),
rtables (>= 0.6.3)
rtables (>= 0.6.4)
Imports:
broom,
car,
Expand All @@ -30,7 +30,7 @@ Imports:
dplyr,
emmeans (>= 1.4.5),
forcats (>= 1.0.0),
formatters (>= 0.5.2),
formatters (>= 0.5.3),
ggplot2 (>= 3.4.0),
grid,
gridExtra,
Expand Down
4 changes: 3 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# tern 0.9.0.9008
# tern 0.9.1.9000

# tern 0.9.1
### New Features
* Added `imputation_rule` function to apply imputation rule to data.
* Added new format function `format_sigfig` to allow for numeric value formatting by a specified number of significant figures.
Expand Down
18 changes: 4 additions & 14 deletions tests/testthat/_snaps/summarize_glm_count.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,6 @@
Intervals are back-transformed from the log scale

---

Code
res
Output
rate asymp.LCL asymp.UCL ARM
A: Drug X 3.07 2.836527 3.32269 A: Drug X
B: Placebo 3.07 2.836527 3.32269 B: Placebo
C: Combination 3.07 2.836527 3.32269 C: Combination

# s_glm_count works with healthy input

Code
Expand All @@ -148,12 +138,12 @@
[1] 73
$rate
[1] 3.486005
[1] 14.11838
attr(,"label")
[1] "Adjusted Rate"
$rate_ci
[1] 3.047667 3.987387
[1] 11.81189 16.87525
attr(,"label")
[1] "95% CI"
Expand Down Expand Up @@ -182,12 +172,12 @@
[1] 73
$rate
[1] 3.486005
[1] 14.11838
attr(,"label")
[1] "Adjusted Rate"
$rate_ci
[1] 3.047667 3.987387
[1] 11.81189 16.87525
attr(,"label")
[1] "95% CI"
Expand Down
15 changes: 7 additions & 8 deletions tests/testthat/test-summarize_glm_count.R
Original file line number Diff line number Diff line change
Expand Up @@ -188,15 +188,14 @@ testthat::test_that("h_ppmeans works with healthy input", {
testthat::expect_snapshot(fits2)

# XXX ppmeans fails snapshot diff in integration tests
result <- h_ppmeans(
obj = fits$glm_fit,
.df_row = anl,
arm = "ARM",
conf_level = 0.95
testthat::expect_silent(
result <- h_ppmeans(
obj = fits$glm_fit,
.df_row = anl,
arm = "ARM",
conf_level = 0.95
) # diff
)

res <- testthat::expect_silent(result)
testthat::expect_snapshot(res) # diff
})

testthat::test_that("s_glm_count works with healthy input", {
Expand Down
3 changes: 0 additions & 3 deletions tests/testthat/test-utils_default_stats_formats_labels.R
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ testthat::test_that("get_formats_from_stats works as expected", {
res <- testthat::expect_silent(get_formats_from_stats(sts))
testthat::expect_equal(names(res), sts)
testthat::expect_equal(res[[1]], "xx.")
testthat::expect_equal(res[[2]], format_count_fraction_fixed_dp)
testthat::expect_equal(res[[3]], format_fraction_fixed_dp)

testthat::expect_null(get_formats_from_stats(c("nothing", "n"))[["nothing"]])

Expand Down Expand Up @@ -151,7 +149,6 @@ testthat::test_that("summary_formats works as expected", {
result <- summary_formats(type = "counts", include_pval = TRUE)
testthat::expect_true(all(result[c("n", "count", "n_blq")] == "xx."))
testthat::expect_identical(result[["pval_counts"]], "x.xxxx | (<0.0001)")
expect_identical(result[["count_fraction"]], format_count_fraction)
})

testthat::test_that("summary_labels works as expected", {
Expand Down

0 comments on commit 4f77c6c

Please sign in to comment.