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 @@
+
+
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 @@
+
+
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 @@
+
+
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 @@
+
+
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 @@
+
+
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 @@
+
+
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 @@
+
+
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 @@
+
+
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 @@
+
+
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 @@
+
+
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 @@
+
+
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 @@
+
+
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 @@
+
+
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 @@
+
+
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 @@
+
+
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 @@
+
+
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 @@
+
+
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 @@
+
+
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 @@
+
+
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 @@
+
+
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 @@
+
+
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 @@
+
+
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 @@
+
+
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 @@
+
+
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 @@
+
+
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 @@
+
+
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 @@
+
+
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 @@
+
+
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 @@
+
+
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 @@
+
+
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 @@
+
+
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 @@
+
+
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 @@
+
+
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 @@
+
+
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 @@
+
+
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 @@
+
+
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 @@
+
+
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 @@
+
+
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 @@
+
+
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 @@
+
+
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 @@
+
+
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 @@
+
+
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 @@
+
+
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 @@
+
+
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 @@
+
+
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 -------------------------------------------------------------