Skip to content

contsurvplot

0.2.3Package record

Visualize the Effect of a Continuous Variable on a Time-to-Event Outcome

0packages depend
4.2Kdownloads / year
99.9%test coverage
12/13flavors OK

Overview

About

Graphically display the (causal) effect of a continuous variable on a time-to-event outcome using multiple different types of plots based on g-computation. Those functions include, among others, survival area plots, survival contour plots, survival quantile plots and 3D surface plots. Due to the use of g-computation, all plot allow confounder-adjustment naturally. For details, see Robin Denz, Nina Timmesfeld (2023) doi:10.1097/EDE.0000000000001630.

Changes in 0.2.3

Enhancements:

  • Added the range_x, range_y and range_z arguments to the plot_surv_3D_surface() function to allow changes of the axis ranges.

New Features:

  • Added the conf_int argument to plot_surv_rmst() and plot_surv_rmtl()

Bug Fixes

  • The legend.position argument in plot_surv_area() is no longer being ignored.
  • Fixed annoying messages printed due to new ggplot2 version.

From NEWS.md in the release

Install

Health

CRAN checks
1ERROR12OK
Check messages
ERRORexamplesr-devel-linux-x86_64-debian-gcc
Running examples in ‘contsurvplot-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: curve_cont
> ### Title: Estimate Counterfactual Survival or Failure Probabilities for
> ###   Levels of a Continuous Variable
> ### Aliases: curve_cont
> 
> ### ** Examples
> 
> library(contsurvplot)
> library(riskRegression)
riskRegression version 2026.03.11
> library(survival)
> 
> # using data from the survival package
> data(nafld, package="survival")
> 
> # take a random sample to keep example fast
> set.seed(42)
> nafld1 <- nafld1[sample(nrow(nafld1), 150), ]
> 
> # fit cox-model with age
> model <- coxph(Surv(futime, status) ~ age, data=nafld1, x=TRUE)
> 
> # estimate survival probability at some points in time, for
> # a range of age values
> plotdata <- curve_cont(data=nafld1,
+                        variable="age",
+                        model=model,
+                        horizon=c(50, 60, 70, 80),
+                        times=c(1000, 2000, 3000, 4000))
Error in a$specials[[i]] : subscript out of bounds
Calls: curve_cont ... predictCox -> coxVariableName -> delete.response -> off
Execution halted
ERRORre-building of vignette outputsr-devel-linux-x86_64-debian-gcc
Error(s) in re-building vignettes:
  ...
--- re-building ‘introduction.Rmd’ using rmarkdown

Quitting from introduction.Rmd:93-96 [unnamed-chunk-7]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<error/rlang_error>
Error in `a$specials[[i]]`:
! subscript out of bounds
---
Backtrace:
    ▆
 1. └─contsurvplot::curve_cont(...)
 2.   └─contsurvplot:::one_iteration(...)
 3.     ├─riskRegression::predictRisk(...)
 4.     └─riskRegression:::predictRisk.coxph(...)
 5.       └─riskRegression::predictCox(...)
 6.         └─riskRegression::coxVariableName(object, model.frame = object.modelFrame)
 7.           └─stats::delete.response(...)
 8.             └─stats (local) off(a$specials[[i]])
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Error: processing vignette 'introduction.Rmd' failed with diagnostics:
subscript out of bounds
--- failed re-building ‘introduction.Rmd’

SUMMARY: processing the following file failed:
  ‘introduction.Rmd’

Error: Vignette re-building failed.
Execution halted
ERRORtestsr-devel-linux-x86_64-debian-gcc
Running ‘testthat.R’ [13s/22s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(contsurvplot)
  Please cite as: 
  
  Denz R, Timmesfeld N (2023). "Visualizing the (Causal) Effect of a Continuous Variable on a Time-To-Event Outcome." Epidemiology, 34 (5). doi: 10.1097/EDE.0000000000001630.
  > library(survival)
  > library(testthat)
  > 
  > test_check("contsurvplot")
  Saving _problems/test_curve_cont-13.R
  Saving _problems/test_curve_cont-20.R
  Saving _problems/test_curve_cont-29.R
  Saving _problems/test_curve_cont-36.R
  starting worker pid=3856762 on localhost:11643 at 16:32:39.392
  starting worker pid=3856763 on localhost:11643 at 16:32:39.438
  Loading required package: contsurvplot
  Please cite as: 
  
  Denz R, Timmesfeld N (2023). "Visualizing the (Causal) Effect of a Continuous Variable on a Time-To-Event Outcome." Epidemiology, 34 (5). doi: 10.1097/EDE.0000000000001630.
  loaded contsurvplot and set parent environment
  Loading required packa
...[truncated]...
ot-change-horizon.svg', 'plot_surv_area/plot-cif.svg',
  'plot_surv_area/plot-custom-colors.svg', 'plot_surv_area/plot-defaults.svg',
  'plot_surv_area/plot-discrete-bins.svg',
  'plot_surv_area/plot-discrete-round.svg',
  'plot_surv_area/plot-lots-of-stuff.svg', 'plot_surv_area/plot-sep-lines.svg',
  'plot_surv_area/plot-with-group.svg',
  'plot_surv_area/plot-with-kaplan-meier.svg',
  'plot_surv_area/plot-with-nonmonotonic.svg',
  'plot_surv_at_t/plot-change-horizon.svg', …,
  'plot_surv_rmtl/plot-with-group-ci.svg', and
  'plot_surv_rmtl/plot-with-group.svg'
  Error:
  ! Test failures.
  Execution halted
  Error in unserialize(node$con) : 
    error reading from connection '->localhost:11643'
  Calls: <Anonymous> ... doTryCatch -> recvData -> recvData.SOCKnode -> unserialize
  Execution halted
  Error in unserialize(node$con) : 
    error reading from connection '->localhost:11643'
  Calls: <Anonymous> ... doTryCatch -> recvData -> recvData.SOCKnode -> unserialize
  Execution halted

CRAN check page ↗

Slowest check: 15.6 min · r-oldrel-windows-x86_64
Status changes
  • ERROR12 OK, 1 ERROR2026-10-24
  • OK13 OK2026-08-05
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK13 OK2026-06-09
  • ERROR12 OK, 1 ERROR2026-06-08
Show 1 earlier changeHide 1 earlier change
  • OK14 OK2026-03-10
Advisories

none known

Documentation

In release 0.2.3
READMEYes · 326 wordsVignettesYes · 1 · dynamicNEWSYes · 100% structured · mentions 0.2.3Citation fileYes · cites a publicationWebsiteYes · pkgdown
Help pages
13includes a package overview page
Examples that run
100%12 run in a plain check
Exported functions with examples
100%
Documented parameters
99%
Return-value docs
100%
Help pages citing references
69%

Downloads

4.2K
CRAN downloads in the past year
Rank #9,964 · ~12/day · ~352/mo
Daily download trend is not available in this view yet.
41830 days
1K90 days
4.2K1 year
Compare downloads with other packages →
Also on104 r2u10 autocran

Repository

16Stars
1Forks
1Open issues
0Open PRs
5Releases
57Commits
2Commit identities
causal-inferencecontinuousg-computationsurvival-analysisvisualization
License file reads as GPL-3.0 · 57 commits · Last activity 2026-01-29 · 0% stars, 30d
Responsiveness
How these are sampled
PRs merged (all time)
0%
Median days to close, 50 most recently updated closed issues
2
Median days to close, 50 most recently updated closed PRs
0

Stars over time

2025-08-04 · 132026-07-07 · 16
PracticesBeta

9 development-tooling and community-health practices detected across 6 families in the upstream repository

Checks run against github.com/robindenz1/contsurvplot on 2026-10-21.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel

Docs source (3)
pkgdown

GitHub Pages site last deployed 2026-01-29 · The repository has a site deploy workflow

pkgdown site last built 2026-01-29

Coverage (1)
Coverage reporting (Codecov)
CRAN release process (1)
cran-comments.md
Show all practicesHide 2 practices
Research and citation (1)
codemeta.json
Lint, format, editor (1)
RStudio project
How this is detected·Detection ruleset v4 (2026-10-20)

Dependencies

Declared dependencies
16 external dependencies (excludes base and recommended)

Installing contsurvplot adds 94 packages (47 with compiled code, 86 MB of source tarballs). Heaviest: stringi 11 MB, TH.data 8.2 MB, ggplot2 6.0 MB.

Depends (0)
none
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

People & History

People (1)
Author, Maintainer since 0.1.0 (2022)
Releases (5)

Pick two releases to compare their code metrics.

  • R
    R 4.6.0 released · 2026-04-24
  • 0.2.3Latest
    record
    2026-01-29 · current release · diff ↗
  • 0.2.2
    record
    2025-07-24 · diff ↗
  • R
    R 4.5.0 released · 2025-04-11
  • R
    R 4.4.0 released · 2024-04-24
  • 0.2.1
    record
    2023-08-15 · diff ↗
  • R
    R 4.3.0 released · 2023-04-21
  • 0.2.0
    record
    2023-01-05 · diff ↗ ·
    added 1 export
    plot_surv_matrix
  • 0.1.0
    record
    2022-08-16
  • R
    R 4.2.0 released · 2022-04-22

Package metadata

First published
2022-08-16
Total releases
5 / 4 yrs
License
GPL (>= 3) OSI
Download size
1.9 MB

Cite

Cite this package

Run in R for the authors' preferred citation:

citation("contsurvplot")

The package provides a citation file that builds its entry when R runs it. Run citation() to see it.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for contsurvplot version 0.2.3 [Data set]. HJJB, LLC. Data release v2026-10-24. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-24, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy