diff --git a/.Rprofile b/.Rprofile new file mode 100644 index 00000000..3192a7c7 --- /dev/null +++ b/.Rprofile @@ -0,0 +1,6 @@ +# this sets the dev folder in the .libPath +# if user has not set up dev mode, nothing will happen +tryCatch( + devtools::dev_mode(on = TRUE), + error = function(e) invisible() +) diff --git a/.gitignore b/.gitignore index 9c54d718..042bee15 100644 --- a/.gitignore +++ b/.gitignore @@ -37,5 +37,3 @@ vignettes/*.pdf inst/doc README.html docs/ -tests/testthat/_snaps/ -.Rprofile diff --git a/DESCRIPTION b/DESCRIPTION index be38991f..ea215f7b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: visR Title: Clinical Graphs and Tables Adhering to Graphical Principles -Version: 0.3.0.9002 +Version: 0.3.0.9003 Authors@R: c( person("Mark", "Baillie", , "bailliem@gmail.com", role = c("aut", "cre", "cph")), person("Diego", "Saldana", , "diego.saldana@roche.com", role = "aut"), diff --git a/NEWS.md b/NEWS.md index 552ae951..b1d84efd 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,10 +1,9 @@ # visR (development version) -### Bug Fixes +* We now zoom in on a figure (e.g. Kaplan-Meier figure) with `ggplot2::coord_cartesian()` instead of using `scale_x_continuous(limits=)` and `scale_y_continuous(limits=)`. The latter first removes data outside the limits, then constructs the line. Zooming constructs the full line, then zooms into the limits. This is useful because the risktable often reports estimates near the end of a KM figure, but the line is cutoff and not shown at the last time point. (#402) * README update to contributor listing. (#435) - # visR 0.3.0 ### New functions diff --git a/R/visr.R b/R/visr.R index 8a10fa02..12484fb2 100644 --- a/R/visr.R +++ b/R/visr.R @@ -271,14 +271,16 @@ visr.survfit <- function(x = NULL, )) + ggplot2::geom_step(ggplot2::aes(y = est, col = strata)) + ggplot2::scale_x_continuous( - breaks = x_ticks, - limits = c(min(x_ticks), max(x_ticks)) + breaks = x_ticks ) + ggplot2::xlab(x_label) + ggplot2::scale_y_continuous( breaks = y_ticks, - labels = yscaleFUN, - limits = c(min(y_ticks), max(y_ticks)) + labels = yscaleFUN + ) + + ggplot2::coord_cartesian( + xlim = c(min(x_ticks), max(x_ticks)), + ylim = c(min(y_ticks), max(y_ticks)) ) + ggplot2::ylab(y_label) + ggplot2::labs(color = .construct_strata_label(x)) + @@ -533,14 +535,16 @@ visr.tidycuminc <- function(x = NULL, )) + ggplot2::geom_step(ggplot2::aes(y = est, col = strata)) + ggplot2::scale_x_continuous( - breaks = x_ticks, - limits = c(min(x_ticks), max(x_ticks)) + breaks = x_ticks ) + ggplot2::xlab(x_label) + ggplot2::scale_y_continuous( breaks = y_ticks, - labels = yscaleFUN, - limits = c(min(y_ticks), max(y_ticks)) + labels = yscaleFUN + ) + + ggplot2::coord_cartesian( + xlim = c(min(x_ticks), max(x_ticks)), + ylim = c(min(y_ticks), max(y_ticks)) ) + ggplot2::ylab(y_label) + ggplot2::labs(color = .construct_strata_label(x)) + diff --git a/tests/testthat/Rplots.pdf b/tests/testthat/Rplots.pdf index 7d60e27e..8d7ad79a 100644 Binary files a/tests/testthat/Rplots.pdf and b/tests/testthat/Rplots.pdf differ diff --git a/tests/testthat/_snaps/add_CI/add-ci-t1-1-no-error-when-default-parameters-are-used.svg b/tests/testthat/_snaps/add_CI/add-ci-t1-1-no-error-when-default-parameters-are-used.svg new file mode 100644 index 00000000..4abf5dd1 --- /dev/null +++ b/tests/testthat/_snaps/add_CI/add-ci-t1-1-no-error-when-default-parameters-are-used.svg @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.20 +0.40 +0.60 +0.80 +1.00 + + + + + + + + + + + + + + + + + +0 +20 +40 +60 +80 +100 +120 +140 +160 +180 +200 +Time to First Dermatologic Event +survival probability + + +Overall +add_CI_T1_1_no_error_when_default_parameters_are_used + + diff --git a/tests/testthat/_snaps/add_CI/add-ci-t1-3-style-ribbon.svg b/tests/testthat/_snaps/add_CI/add-ci-t1-3-style-ribbon.svg new file mode 100644 index 00000000..979604d4 --- /dev/null +++ b/tests/testthat/_snaps/add_CI/add-ci-t1-3-style-ribbon.svg @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.20 +0.40 +0.60 +0.80 +1.00 + + + + + + + + + + + + + + + + + +0 +20 +40 +60 +80 +100 +120 +140 +160 +180 +200 +Time to First Dermatologic Event +survival probability + +Sex + + +F +M +add_CI_T1_3_style_ribbon + + diff --git a/tests/testthat/_snaps/add_CI/add-ci-t1-3-style-step.svg b/tests/testthat/_snaps/add_CI/add-ci-t1-3-style-step.svg new file mode 100644 index 00000000..75017ed1 --- /dev/null +++ b/tests/testthat/_snaps/add_CI/add-ci-t1-3-style-step.svg @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.20 +0.40 +0.60 +0.80 +1.00 + + + + + + + + + + + + + + + + + +0 +20 +40 +60 +80 +100 +120 +140 +160 +180 +200 +Time to First Dermatologic Event +survival probability + +Sex + + +F +M +add_CI_T1_3_style_step + + diff --git a/tests/testthat/_snaps/add_CI/add-ci-t1-4-linetype-0.svg b/tests/testthat/_snaps/add_CI/add-ci-t1-4-linetype-0.svg new file mode 100644 index 00000000..020bbfc9 --- /dev/null +++ b/tests/testthat/_snaps/add_CI/add-ci-t1-4-linetype-0.svg @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.20 +0.40 +0.60 +0.80 +1.00 + + + + + + + + + + + + + + + + + +0 +20 +40 +60 +80 +100 +120 +140 +160 +180 +200 +Time to First Dermatologic Event +survival probability + +Sex + + +F +M +add_CI_T1_4_linetype_0 + + diff --git a/tests/testthat/_snaps/add_CI/add-ci-t1-4-linetype-1.svg b/tests/testthat/_snaps/add_CI/add-ci-t1-4-linetype-1.svg new file mode 100644 index 00000000..4e56c585 --- /dev/null +++ b/tests/testthat/_snaps/add_CI/add-ci-t1-4-linetype-1.svg @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.20 +0.40 +0.60 +0.80 +1.00 + + + + + + + + + + + + + + + + + +0 +20 +40 +60 +80 +100 +120 +140 +160 +180 +200 +Time to First Dermatologic Event +survival probability + +Sex + + +F +M +add_CI_T1_4_linetype_1 + + diff --git a/tests/testthat/_snaps/add_CI/add-ci-t1-4-linetype-2.svg b/tests/testthat/_snaps/add_CI/add-ci-t1-4-linetype-2.svg new file mode 100644 index 00000000..0e76dc8a --- /dev/null +++ b/tests/testthat/_snaps/add_CI/add-ci-t1-4-linetype-2.svg @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.20 +0.40 +0.60 +0.80 +1.00 + + + + + + + + + + + + + + + + + +0 +20 +40 +60 +80 +100 +120 +140 +160 +180 +200 +Time to First Dermatologic Event +survival probability + +Sex + + +F +M +add_CI_T1_4_linetype_2 + + diff --git a/tests/testthat/_snaps/add_CI/add-ci-t1-4-linetype-3.svg b/tests/testthat/_snaps/add_CI/add-ci-t1-4-linetype-3.svg new file mode 100644 index 00000000..9e6fe380 --- /dev/null +++ b/tests/testthat/_snaps/add_CI/add-ci-t1-4-linetype-3.svg @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.20 +0.40 +0.60 +0.80 +1.00 + + + + + + + + + + + + + + + + + +0 +20 +40 +60 +80 +100 +120 +140 +160 +180 +200 +Time to First Dermatologic Event +survival probability + +Sex + + +F +M +add_CI_T1_4_linetype_3 + + diff --git a/tests/testthat/_snaps/add_CI/add-ci-t1-4-linetype-4.svg b/tests/testthat/_snaps/add_CI/add-ci-t1-4-linetype-4.svg new file mode 100644 index 00000000..2fbd9058 --- /dev/null +++ b/tests/testthat/_snaps/add_CI/add-ci-t1-4-linetype-4.svg @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.20 +0.40 +0.60 +0.80 +1.00 + + + + + + + + + + + + + + + + + +0 +20 +40 +60 +80 +100 +120 +140 +160 +180 +200 +Time to First Dermatologic Event +survival probability + +Sex + + +F +M +add_CI_T1_4_linetype_4 + + diff --git a/tests/testthat/_snaps/add_CI/add-ci-t1-4-linetype-5.svg b/tests/testthat/_snaps/add_CI/add-ci-t1-4-linetype-5.svg new file mode 100644 index 00000000..cb27b7d5 --- /dev/null +++ b/tests/testthat/_snaps/add_CI/add-ci-t1-4-linetype-5.svg @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.20 +0.40 +0.60 +0.80 +1.00 + + + + + + + + + + + + + + + + + +0 +20 +40 +60 +80 +100 +120 +140 +160 +180 +200 +Time to First Dermatologic Event +survival probability + +Sex + + +F +M +add_CI_T1_4_linetype_5 + + diff --git a/tests/testthat/_snaps/add_CI/add-ci-t1-4-linetype-6.svg b/tests/testthat/_snaps/add_CI/add-ci-t1-4-linetype-6.svg new file mode 100644 index 00000000..193a52b5 --- /dev/null +++ b/tests/testthat/_snaps/add_CI/add-ci-t1-4-linetype-6.svg @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.20 +0.40 +0.60 +0.80 +1.00 + + + + + + + + + + + + + + + + + +0 +20 +40 +60 +80 +100 +120 +140 +160 +180 +200 +Time to First Dermatologic Event +survival probability + +Sex + + +F +M +add_CI_T1_4_linetype_6 + + diff --git a/tests/testthat/_snaps/add_CI/add-ci-t1-4-linetype-blank.svg b/tests/testthat/_snaps/add_CI/add-ci-t1-4-linetype-blank.svg new file mode 100644 index 00000000..72656e43 --- /dev/null +++ b/tests/testthat/_snaps/add_CI/add-ci-t1-4-linetype-blank.svg @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.20 +0.40 +0.60 +0.80 +1.00 + + + + + + + + + + + + + + + + + +0 +20 +40 +60 +80 +100 +120 +140 +160 +180 +200 +Time to First Dermatologic Event +survival probability + +Sex + + +F +M +add_CI_T1_4_linetype_blank + + diff --git a/tests/testthat/_snaps/add_CI/add-ci-t1-4-linetype-dashed.svg b/tests/testthat/_snaps/add_CI/add-ci-t1-4-linetype-dashed.svg new file mode 100644 index 00000000..35330d66 --- /dev/null +++ b/tests/testthat/_snaps/add_CI/add-ci-t1-4-linetype-dashed.svg @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.20 +0.40 +0.60 +0.80 +1.00 + + + + + + + + + + + + + + + + + +0 +20 +40 +60 +80 +100 +120 +140 +160 +180 +200 +Time to First Dermatologic Event +survival probability + +Sex + + +F +M +add_CI_T1_4_linetype_dashed + + diff --git a/tests/testthat/_snaps/add_CI/add-ci-t1-4-linetype-dotdash.svg b/tests/testthat/_snaps/add_CI/add-ci-t1-4-linetype-dotdash.svg new file mode 100644 index 00000000..16d58f60 --- /dev/null +++ b/tests/testthat/_snaps/add_CI/add-ci-t1-4-linetype-dotdash.svg @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.20 +0.40 +0.60 +0.80 +1.00 + + + + + + + + + + + + + + + + + +0 +20 +40 +60 +80 +100 +120 +140 +160 +180 +200 +Time to First Dermatologic Event +survival probability + +Sex + + +F +M +add_CI_T1_4_linetype_dotdash + + diff --git a/tests/testthat/_snaps/add_CI/add-ci-t1-4-linetype-dotted.svg b/tests/testthat/_snaps/add_CI/add-ci-t1-4-linetype-dotted.svg new file mode 100644 index 00000000..11f1f710 --- /dev/null +++ b/tests/testthat/_snaps/add_CI/add-ci-t1-4-linetype-dotted.svg @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.20 +0.40 +0.60 +0.80 +1.00 + + + + + + + + + + + + + + + + + +0 +20 +40 +60 +80 +100 +120 +140 +160 +180 +200 +Time to First Dermatologic Event +survival probability + +Sex + + +F +M +add_CI_T1_4_linetype_dotted + + diff --git a/tests/testthat/_snaps/add_CI/add-ci-t1-4-linetype-longdash.svg b/tests/testthat/_snaps/add_CI/add-ci-t1-4-linetype-longdash.svg new file mode 100644 index 00000000..3b4010b7 --- /dev/null +++ b/tests/testthat/_snaps/add_CI/add-ci-t1-4-linetype-longdash.svg @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.20 +0.40 +0.60 +0.80 +1.00 + + + + + + + + + + + + + + + + + +0 +20 +40 +60 +80 +100 +120 +140 +160 +180 +200 +Time to First Dermatologic Event +survival probability + +Sex + + +F +M +add_CI_T1_4_linetype_longdash + + diff --git a/tests/testthat/_snaps/add_CI/add-ci-t1-4-linetype-solid.svg b/tests/testthat/_snaps/add_CI/add-ci-t1-4-linetype-solid.svg new file mode 100644 index 00000000..476cd7d6 --- /dev/null +++ b/tests/testthat/_snaps/add_CI/add-ci-t1-4-linetype-solid.svg @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.20 +0.40 +0.60 +0.80 +1.00 + + + + + + + + + + + + + + + + + +0 +20 +40 +60 +80 +100 +120 +140 +160 +180 +200 +Time to First Dermatologic Event +survival probability + +Sex + + +F +M +add_CI_T1_4_linetype_solid + + diff --git a/tests/testthat/_snaps/add_CI/add-ci-t1-4-linetype-twodash.svg b/tests/testthat/_snaps/add_CI/add-ci-t1-4-linetype-twodash.svg new file mode 100644 index 00000000..efe9130f --- /dev/null +++ b/tests/testthat/_snaps/add_CI/add-ci-t1-4-linetype-twodash.svg @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.20 +0.40 +0.60 +0.80 +1.00 + + + + + + + + + + + + + + + + + +0 +20 +40 +60 +80 +100 +120 +140 +160 +180 +200 +Time to First Dermatologic Event +survival probability + +Sex + + +F +M +add_CI_T1_4_linetype_twodash + + diff --git a/tests/testthat/_snaps/add_CI/add-ci-t1-alpha-0.svg b/tests/testthat/_snaps/add_CI/add-ci-t1-alpha-0.svg new file mode 100644 index 00000000..530f3bd9 --- /dev/null +++ b/tests/testthat/_snaps/add_CI/add-ci-t1-alpha-0.svg @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.20 +0.40 +0.60 +0.80 +1.00 + + + + + + + + + + + + + + + + + +0 +20 +40 +60 +80 +100 +120 +140 +160 +180 +200 +Time to First Dermatologic Event +survival probability + +Sex + + +F +M +add_CI_T1_alpha_0 + + diff --git a/tests/testthat/_snaps/add_CI/add-ci-t1-alpha-05.svg b/tests/testthat/_snaps/add_CI/add-ci-t1-alpha-05.svg new file mode 100644 index 00000000..7f5ace26 --- /dev/null +++ b/tests/testthat/_snaps/add_CI/add-ci-t1-alpha-05.svg @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.20 +0.40 +0.60 +0.80 +1.00 + + + + + + + + + + + + + + + + + +0 +20 +40 +60 +80 +100 +120 +140 +160 +180 +200 +Time to First Dermatologic Event +survival probability + +Sex + + +F +M +add_CI_T1_alpha_05 + + diff --git a/tests/testthat/_snaps/add_CI/add-ci-t1-alpha-1.svg b/tests/testthat/_snaps/add_CI/add-ci-t1-alpha-1.svg new file mode 100644 index 00000000..31c2581c --- /dev/null +++ b/tests/testthat/_snaps/add_CI/add-ci-t1-alpha-1.svg @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.20 +0.40 +0.60 +0.80 +1.00 + + + + + + + + + + + + + + + + + +0 +20 +40 +60 +80 +100 +120 +140 +160 +180 +200 +Time to First Dermatologic Event +survival probability + +Sex + + +F +M +add_CI_T1_alpha_1 + + diff --git a/tests/testthat/_snaps/add_CI/add-ci-t2-1-one-strata.svg b/tests/testthat/_snaps/add_CI/add-ci-t2-1-one-strata.svg new file mode 100644 index 00000000..2cfc9e05 --- /dev/null +++ b/tests/testthat/_snaps/add_CI/add-ci-t2-1-one-strata.svg @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.20 +0.40 +0.60 +0.80 +1.00 + + + + + + + + + + + + + + + + + +0 +20 +40 +60 +80 +100 +120 +140 +160 +180 +200 +Time to First Dermatologic Event +survival probability + + +Overall +add_CI_T2_1_one_strata + + diff --git a/tests/testthat/_snaps/add_CI/add-ci-t2-2-10strata.svg b/tests/testthat/_snaps/add_CI/add-ci-t2-2-10strata.svg new file mode 100644 index 00000000..7c365652 --- /dev/null +++ b/tests/testthat/_snaps/add_CI/add-ci-t2-2-10strata.svg @@ -0,0 +1,166 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.20 +0.40 +0.60 +0.80 +1.00 + + + + + + + + + + + + + + + + + +0 +20 +40 +60 +80 +100 +120 +140 +160 +180 +200 +Time to First Dermatologic Event +survival probability + +TRTDUR + + + + + + + + + + +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +add_CI_T2_2_10strata + + diff --git a/tests/testthat/_snaps/add_CI/add-ci-t2-2-20strata.svg b/tests/testthat/_snaps/add_CI/add-ci-t2-2-20strata.svg new file mode 100644 index 00000000..68f289f3 --- /dev/null +++ b/tests/testthat/_snaps/add_CI/add-ci-t2-2-20strata.svg @@ -0,0 +1,226 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.20 +0.40 +0.60 +0.80 +1.00 + + + + + + + + + + + + + + + + + +0 +20 +40 +60 +80 +100 +120 +140 +160 +180 +200 +Time to First Dermatologic Event +survival probability + +TRTDUR + + + + + + + + + + + + + + + + + + + + +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +20 +add_CI_T2_2_20strata + + diff --git a/tests/testthat/_snaps/add_CI/add-ci-t2-2-5strata.svg b/tests/testthat/_snaps/add_CI/add-ci-t2-2-5strata.svg new file mode 100644 index 00000000..f5d355da --- /dev/null +++ b/tests/testthat/_snaps/add_CI/add-ci-t2-2-5strata.svg @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.20 +0.40 +0.60 +0.80 +1.00 + + + + + + + + + + + + + + + + + +0 +20 +40 +60 +80 +100 +120 +140 +160 +180 +200 +Time to First Dermatologic Event +survival probability + +TRTDUR + + + + + +1 +2 +3 +4 +5 +add_CI_T2_2_5strata + + diff --git a/tests/testthat/_snaps/add_CNSR/add-cnsr-t1-1-one-strata.svg b/tests/testthat/_snaps/add_CNSR/add-cnsr-t1-1-one-strata.svg new file mode 100644 index 00000000..84a7a150 --- /dev/null +++ b/tests/testthat/_snaps/add_CNSR/add-cnsr-t1-1-one-strata.svg @@ -0,0 +1,226 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.20 +0.40 +0.60 +0.80 +1.00 + + + + + + + + + + + + + + + + + +0 +20 +40 +60 +80 +100 +120 +140 +160 +180 +200 +Time to First Dermatologic Event +survival probability + + +Overall +add_CNSR_T1_1_one_strata + + diff --git a/tests/testthat/_snaps/add_CNSR/add-cnsr-t1-2-trtp.svg b/tests/testthat/_snaps/add_CNSR/add-cnsr-t1-2-trtp.svg new file mode 100644 index 00000000..c3d834fe --- /dev/null +++ b/tests/testthat/_snaps/add_CNSR/add-cnsr-t1-2-trtp.svg @@ -0,0 +1,263 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.20 +0.40 +0.60 +0.80 +1.00 + + + + + + + + + + + + + + + + + +0 +20 +40 +60 +80 +100 +120 +140 +160 +180 +200 +Time to First Dermatologic Event +survival probability + +Planned Treatment + + + +Placebo +Xanomeline High Dose +Xanomeline Low Dose +add_CNSR_T1_2_TRTP + + diff --git a/tests/testthat/_snaps/add_CNSR/add-cnsr-t1-3-shape-empty-string.svg b/tests/testthat/_snaps/add_CNSR/add-cnsr-t1-3-shape-empty-string.svg new file mode 100644 index 00000000..392e1a0e --- /dev/null +++ b/tests/testthat/_snaps/add_CNSR/add-cnsr-t1-3-shape-empty-string.svg @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.20 +0.40 +0.60 +0.80 +1.00 + + + + + + + + + + + + + + + + + +0 +20 +40 +60 +80 +100 +120 +140 +160 +180 +200 +Time to First Dermatologic Event +survival probability + +Sex + + +F +M +add_CNSR_T1_3_shape_empty_string + + diff --git a/tests/testthat/_snaps/add_CNSR/add-cnsr-t1-4-shape-valid-numerical.svg b/tests/testthat/_snaps/add_CNSR/add-cnsr-t1-4-shape-valid-numerical.svg new file mode 100644 index 00000000..a6e34012 --- /dev/null +++ b/tests/testthat/_snaps/add_CNSR/add-cnsr-t1-4-shape-valid-numerical.svg @@ -0,0 +1,182 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.20 +0.40 +0.60 +0.80 +1.00 + + + + + + + + + + + + + + + + + +0 +20 +40 +60 +80 +100 +120 +140 +160 +180 +200 +Time to First Dermatologic Event +survival probability + +Sex + + +F +M +add_CNSR_T1_4_shape_valid_numerical + + diff --git a/tests/testthat/_snaps/add_CNSR/add-cnsr-t1-5-shape-atomic-string.svg b/tests/testthat/_snaps/add_CNSR/add-cnsr-t1-5-shape-atomic-string.svg new file mode 100644 index 00000000..1c679746 --- /dev/null +++ b/tests/testthat/_snaps/add_CNSR/add-cnsr-t1-5-shape-atomic-string.svg @@ -0,0 +1,182 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ +µ + + +0.00 +0.20 +0.40 +0.60 +0.80 +1.00 + + + + + + + + + + + + + + + + + +0 +20 +40 +60 +80 +100 +120 +140 +160 +180 +200 +Time to First Dermatologic Event +survival probability + +Sex + + +F +M +add_CNSR_T1_5_shape_atomic_string + + diff --git a/tests/testthat/_snaps/add_CNSR/add-cnsr-t1-7-size-negative-numerical.svg b/tests/testthat/_snaps/add_CNSR/add-cnsr-t1-7-size-negative-numerical.svg new file mode 100644 index 00000000..89918b11 --- /dev/null +++ b/tests/testthat/_snaps/add_CNSR/add-cnsr-t1-7-size-negative-numerical.svg @@ -0,0 +1,252 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.20 +0.40 +0.60 +0.80 +1.00 + + + + + + + + + + + + + + + + + +0 +20 +40 +60 +80 +100 +120 +140 +160 +180 +200 +Time to First Dermatologic Event +survival probability + +Sex + + +F +M +add_CNSR_T1_7_size_negative_numerical + + diff --git a/tests/testthat/_snaps/add_CNSR/add-cnsr-t1-7-size-positive-numerical.svg b/tests/testthat/_snaps/add_CNSR/add-cnsr-t1-7-size-positive-numerical.svg new file mode 100644 index 00000000..a0a94b2c --- /dev/null +++ b/tests/testthat/_snaps/add_CNSR/add-cnsr-t1-7-size-positive-numerical.svg @@ -0,0 +1,252 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.20 +0.40 +0.60 +0.80 +1.00 + + + + + + + + + + + + + + + + + +0 +20 +40 +60 +80 +100 +120 +140 +160 +180 +200 +Time to First Dermatologic Event +survival probability + +Sex + + +F +M +add_CNSR_T1_7_size_positive_numerical + + diff --git a/tests/testthat/_snaps/add_CNSR/add-cnsr-t1-7-size-zero.svg b/tests/testthat/_snaps/add_CNSR/add-cnsr-t1-7-size-zero.svg new file mode 100644 index 00000000..c99cefd7 --- /dev/null +++ b/tests/testthat/_snaps/add_CNSR/add-cnsr-t1-7-size-zero.svg @@ -0,0 +1,252 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.20 +0.40 +0.60 +0.80 +1.00 + + + + + + + + + + + + + + + + + +0 +20 +40 +60 +80 +100 +120 +140 +160 +180 +200 +Time to First Dermatologic Event +survival probability + +Sex + + +F +M +add_CNSR_T1_7_size_zero + + diff --git a/tests/testthat/_snaps/add_highlight/add-highlight-t2-1-no-error-when-strata-is-string.svg b/tests/testthat/_snaps/add_highlight/add-highlight-t2-1-no-error-when-strata-is-string.svg new file mode 100644 index 00000000..6d0d1d7f --- /dev/null +++ b/tests/testthat/_snaps/add_highlight/add-highlight-t2-1-no-error-when-strata-is-string.svg @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.20 +0.40 +0.60 +0.80 +1.00 + + + + + + + + + + + + + + + + + +0 +20 +40 +60 +80 +100 +120 +140 +160 +180 +200 +Time to First Dermatologic Event +survival probability + +Planned Treatment + + + +Placebo +Xanomeline High Dose +Xanomeline Low Dose +add_highlight_T2_1_no_error_when_strata_is_string + + diff --git a/tests/testthat/_snaps/add_highlight/add-highlight-t2-4-no-error-when-strata-is-string-list.svg b/tests/testthat/_snaps/add_highlight/add-highlight-t2-4-no-error-when-strata-is-string-list.svg new file mode 100644 index 00000000..613d68e8 --- /dev/null +++ b/tests/testthat/_snaps/add_highlight/add-highlight-t2-4-no-error-when-strata-is-string-list.svg @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.20 +0.40 +0.60 +0.80 +1.00 + + + + + + + + + + + + + + + + + +0 +20 +40 +60 +80 +100 +120 +140 +160 +180 +200 +Time to First Dermatologic Event +survival probability + +Planned Treatment + + + +Placebo +Xanomeline High Dose +Xanomeline Low Dose +add_highlight_T2_4_no_error_when_strata_is_string_list + + diff --git a/tests/testthat/_snaps/add_highlight/add-highlight-t2-4-no-error-when-strata-is-string-vec.svg b/tests/testthat/_snaps/add_highlight/add-highlight-t2-4-no-error-when-strata-is-string-vec.svg new file mode 100644 index 00000000..a733fef7 --- /dev/null +++ b/tests/testthat/_snaps/add_highlight/add-highlight-t2-4-no-error-when-strata-is-string-vec.svg @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.20 +0.40 +0.60 +0.80 +1.00 + + + + + + + + + + + + + + + + + +0 +20 +40 +60 +80 +100 +120 +140 +160 +180 +200 +Time to First Dermatologic Event +survival probability + +Planned Treatment + + + +Placebo +Xanomeline High Dose +Xanomeline Low Dose +add_highlight_T2_4_no_error_when_strata_is_string_vec + + diff --git a/tests/testthat/_snaps/add_highlight/add-highlight-t3-4-bg-alpha-is-0-4.svg b/tests/testthat/_snaps/add_highlight/add-highlight-t3-4-bg-alpha-is-0-4.svg new file mode 100644 index 00000000..8dc21bc2 --- /dev/null +++ b/tests/testthat/_snaps/add_highlight/add-highlight-t3-4-bg-alpha-is-0-4.svg @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.20 +0.40 +0.60 +0.80 +1.00 + + + + + + + + + + + + + + + + + +0 +20 +40 +60 +80 +100 +120 +140 +160 +180 +200 +Time to First Dermatologic Event +survival probability + +Planned Treatment + + + +Placebo +Xanomeline High Dose +Xanomeline Low Dose +add_highlight_T3_4_bg_alpha_is_0_4 + + diff --git a/tests/testthat/_snaps/add_highlight/add-highlight-t3-4-bg-alpha-is-0.svg b/tests/testthat/_snaps/add_highlight/add-highlight-t3-4-bg-alpha-is-0.svg new file mode 100644 index 00000000..2aebbff3 --- /dev/null +++ b/tests/testthat/_snaps/add_highlight/add-highlight-t3-4-bg-alpha-is-0.svg @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.20 +0.40 +0.60 +0.80 +1.00 + + + + + + + + + + + + + + + + + +0 +20 +40 +60 +80 +100 +120 +140 +160 +180 +200 +Time to First Dermatologic Event +survival probability + +Planned Treatment + + + +Placebo +Xanomeline High Dose +Xanomeline Low Dose +add_highlight_T3_4_bg_alpha_is_0 + + diff --git a/tests/testthat/_snaps/add_highlight/add-highlight-t3-4-bg-alpha-is-1.svg b/tests/testthat/_snaps/add_highlight/add-highlight-t3-4-bg-alpha-is-1.svg new file mode 100644 index 00000000..bd6989cd --- /dev/null +++ b/tests/testthat/_snaps/add_highlight/add-highlight-t3-4-bg-alpha-is-1.svg @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.20 +0.40 +0.60 +0.80 +1.00 + + + + + + + + + + + + + + + + + +0 +20 +40 +60 +80 +100 +120 +140 +160 +180 +200 +Time to First Dermatologic Event +survival probability + +Planned Treatment + + + +Placebo +Xanomeline High Dose +Xanomeline Low Dose +add_highlight_T3_4_bg_alpha_is_1 + + diff --git a/tests/testthat/_snaps/add_risktable/add-risktable-t2-3-aligned-when-no-legend.svg b/tests/testthat/_snaps/add_risktable/add-risktable-t2-3-aligned-when-no-legend.svg new file mode 100644 index 00000000..49bfbe1b --- /dev/null +++ b/tests/testthat/_snaps/add_risktable/add-risktable-t2-3-aligned-when-no-legend.svg @@ -0,0 +1,214 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.20 +0.40 +0.60 +0.80 +1.00 + + + + + + + + + + + + + + + + + +0 +20 +40 +60 +80 +100 +120 +140 +160 +180 +200 +Time to First Dermatologic Event +survival probability + + + + + + + + + + + + + + + + + + +86 +75 +65 +59 +50 +47 +45 +42 +40 +35 + 0 + + +At risk +Placebo + + + + + + + + + + + + + + + + + + +84 +48 +31 +14 + 7 + 4 + 4 + 4 + 4 + 3 + 0 + + +At risk +Xanomeline High Dose + + + + + + + + + + + + + + + + + + +84 +58 +31 +20 +14 +12 + 8 + 6 + 6 + 5 + 0 + + +At risk +Xanomeline Low Dose + + diff --git a/tests/testthat/_snaps/add_risktable/add-risktable-t2-4-aligned-when-legend.svg b/tests/testthat/_snaps/add_risktable/add-risktable-t2-4-aligned-when-legend.svg new file mode 100644 index 00000000..4ccd73ec --- /dev/null +++ b/tests/testthat/_snaps/add_risktable/add-risktable-t2-4-aligned-when-legend.svg @@ -0,0 +1,222 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.20 +0.40 +0.60 +0.80 +1.00 + + + + + + + + + + + + + + + + + +0 +20 +40 +60 +80 +100 +120 +140 +160 +180 +200 +Time to First Dermatologic Event +survival probability + +Actual Treatment + + + +Placebo +Xanomeline High Dose +Xanomeline Low Dose + + + + + + + + + + + + + + + + + + +86 +75 +65 +59 +50 +47 +45 +42 +40 +35 + 0 + + +At risk +Placebo + + + + + + + + + + + + + + + + + + +84 +48 +31 +14 + 7 + 4 + 4 + 4 + 4 + 3 + 0 + + +At risk +Xanomeline High Dose + + + + + + + + + + + + + + + + + + +84 +58 +31 +20 +14 +12 + 8 + 6 + 6 + 5 + 0 + + +At risk +Xanomeline Low Dose + + diff --git a/tests/testthat/_snaps/add_risktable/t4-6-changing-rowgutter-affects-on-the-heights-of-the-table-and-plot.svg b/tests/testthat/_snaps/add_risktable/t4-6-changing-rowgutter-affects-on-the-heights-of-the-table-and-plot.svg new file mode 100644 index 00000000..3878fad2 --- /dev/null +++ b/tests/testthat/_snaps/add_risktable/t4-6-changing-rowgutter-affects-on-the-heights-of-the-table-and-plot.svg @@ -0,0 +1,222 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.20 +0.40 +0.60 +0.80 +1.00 + + + + + + + + + + + + + + + + + +0 +20 +40 +60 +80 +100 +120 +140 +160 +180 +200 +Time to First Dermatologic Event +survival probability + +Actual Treatment + + + +Placebo +Xanomeline High Dose +Xanomeline Low Dose + + + + + + + + + + + + + + + + + + +86 +75 +65 +59 +50 +47 +45 +42 +40 +35 + 0 + + +At risk +Placebo + + + + + + + + + + + + + + + + + + +84 +48 +31 +14 + 7 + 4 + 4 + 4 + 4 + 3 + 0 + + +At risk +Xanomeline High Dose + + + + + + + + + + + + + + + + + + +84 +58 +31 +20 +14 +12 + 8 + 6 + 6 + 5 + 0 + + +At risk +Xanomeline Low Dose + + diff --git a/tests/testthat/_snaps/add_risktable/t4-no-error-when-the-default-rowgutter-is-used.svg b/tests/testthat/_snaps/add_risktable/t4-no-error-when-the-default-rowgutter-is-used.svg new file mode 100644 index 00000000..3f84643f --- /dev/null +++ b/tests/testthat/_snaps/add_risktable/t4-no-error-when-the-default-rowgutter-is-used.svg @@ -0,0 +1,222 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.20 +0.40 +0.60 +0.80 +1.00 + + + + + + + + + + + + + + + + + +0 +20 +40 +60 +80 +100 +120 +140 +160 +180 +200 +Time to First Dermatologic Event +survival probability + +Actual Treatment + + + +Placebo +Xanomeline High Dose +Xanomeline Low Dose + + + + + + + + + + + + + + + + + + +86 +75 +65 +59 +50 +47 +45 +42 +40 +35 + 0 + + +At risk +Placebo + + + + + + + + + + + + + + + + + + +84 +48 +31 +14 + 7 + 4 + 4 + 4 + 4 + 3 + 0 + + +At risk +Xanomeline High Dose + + + + + + + + + + + + + + + + + + +84 +58 +31 +20 +14 +12 + 8 + 6 + 6 + 5 + 0 + + +At risk +Xanomeline Low Dose + + diff --git a/tests/testthat/_snaps/utils_visR/utils-visr-t2-3-yaxis-labels-aligned-when-no-legend.svg b/tests/testthat/_snaps/utils_visR/utils-visr-t2-3-yaxis-labels-aligned-when-no-legend.svg new file mode 100644 index 00000000..d6fe7f7b --- /dev/null +++ b/tests/testthat/_snaps/utils_visR/utils-visr-t2-3-yaxis-labels-aligned-when-no-legend.svg @@ -0,0 +1,211 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.20 +0.40 +0.60 +0.80 +1.00 + + + + + + + + + + + + + + + + + +0 +20 +40 +60 +80 +100 +120 +140 +160 +180 +200 +Time to First Dermatologic Event +survival probability + + + + + + + + + + + + + + + + + + +53 +46 +38 +34 +27 +26 +25 +24 +23 +20 + 0 +40 +24 +20 +10 + 4 + 2 + 2 + 2 + 2 + 2 + 0 +50 +37 +23 +16 +12 +11 + 8 + 6 + 6 + 5 + 0 +33 +29 +27 +25 +23 +21 +20 +18 +17 +15 + 0 +44 +24 +11 + 4 + 3 + 2 + 2 + 2 + 2 + 1 + 0 +34 +21 + 8 + 4 + 2 + 1 + 0 + 0 + 0 + 0 + 0 + + +M, Xanomeline Low Dose +M, Xanomeline High Dose +M, Placebo +F, Xanomeline Low Dose +F, Xanomeline High Dose +F, Placebo +At risk + + diff --git a/tests/testthat/_snaps/utils_visR/utils-visr-t2-4-yaxis-labels-aligned-when-legend.svg b/tests/testthat/_snaps/utils_visR/utils-visr-t2-4-yaxis-labels-aligned-when-legend.svg new file mode 100644 index 00000000..8bf465fd --- /dev/null +++ b/tests/testthat/_snaps/utils_visR/utils-visr-t2-4-yaxis-labels-aligned-when-legend.svg @@ -0,0 +1,225 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.20 +0.40 +0.60 +0.80 +1.00 + + + + + + + + + + + + + + + + + +0 +20 +40 +60 +80 +100 +120 +140 +160 +180 +200 +Time to First Dermatologic Event +survival probability + +Sex, Planned Treatment + + + + + + +F, Placebo +F, Xanomeline High Dose +F, Xanomeline Low Dose +M, Placebo +M, Xanomeline High Dose +M, Xanomeline Low Dose + + + + + + + + + + + + + + + + + + +53 +46 +38 +34 +27 +26 +25 +24 +23 +20 + 0 +40 +24 +20 +10 + 4 + 2 + 2 + 2 + 2 + 2 + 0 +50 +37 +23 +16 +12 +11 + 8 + 6 + 6 + 5 + 0 +33 +29 +27 +25 +23 +21 +20 +18 +17 +15 + 0 +44 +24 +11 + 4 + 3 + 2 + 2 + 2 + 2 + 1 + 0 +34 +21 + 8 + 4 + 2 + 1 + 0 + 0 + 0 + 0 + 0 + + +M, Xanomeline Low Dose +M, Xanomeline High Dose +M, Placebo +F, Xanomeline Low Dose +F, Xanomeline High Dose +F, Placebo +At risk + + diff --git a/tests/testthat/_snaps/visr_survfit/plot-zoom.svg b/tests/testthat/_snaps/visr_survfit/plot-zoom.svg new file mode 100644 index 00000000..1bb632c2 --- /dev/null +++ b/tests/testthat/_snaps/visr_survfit/plot-zoom.svg @@ -0,0 +1,149 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.00 +0.20 +0.40 +0.60 +0.80 +1.00 + + + + + + + + + + + + + + + + + +0 +200 +400 +600 +800 +1000 +1200 +1400 +1600 +1800 +2000 +Time +survival probability + + +Overall + + + + + + + + + + + + + + + + + + +228 +144 + 57 + 24 + 8 + 2 + 2 + 2 + 2 + 2 + 2 + + +At risk +Overall + + diff --git a/tests/testthat/test-visr_survfit.R b/tests/testthat/test-visr_survfit.R index 55925d86..fa014eec 100644 --- a/tests/testthat/test-visr_survfit.R +++ b/tests/testthat/test-visr_survfit.R @@ -47,6 +47,8 @@ #' T5. The final object is a ggplot of class `ggsurvfit`. #' T5.1 The final object is a ggplot of class `ggplot`. #' T5.2 The final object is a ggplot of class `ggsurvfit`. +#' T6. The final object does not exclude parts of KM estimate. +#' T6.1 The final object zooms and does not exclude trialing pieces of lines. # Requirement T1 ---------------------------------------------------------- @@ -510,4 +512,20 @@ testthat::test_that("T5.2 The final object is a ggplot of class `ggsurvfit`.", { testthat::expect_true(inherits(survfit_plot, "ggsurvfit")) }) +# Requirement T6 --------------------------------------------------------------- + +testthat::context("visr_plot - T6. The final object does not exclude parts of KM estimate.") + +testthat::test_that("T6.1 The final object zooms and does not exclude trialing pieces of lines.", { + plot.zoom <- + visR::estimate_KM( + data = survival::lung %>% dplyr::mutate(time = ifelse(time > 1000, 2001, time)), + formula = survival::Surv(time, status) ~ 1 + ) %>% + visR::visr(x_ticks = seq(0, 2000, by = 200)) %>% + visR::add_risktable() + + vdiffr::expect_doppelganger("plot-zoom", plot.zoom) +}) + # END OF CODE -------------------------------------------------------------