Releases: kassambara/survminer
survminer 0.5.1
Bug fixes
- Fix chart/risk table misalignment with ggplot2 >= 3.5.0 by using dynamic panel detection instead of hardcoded grob indices (#649, #675)
- Fix R CMD check global variable binding warnings in
.add_surv_median() - Fix
ggcoxdiagnostics()x-axis scaling when usingox.scale = "time"with Schoenfeld residuals (#608) - Fix ggplot2 3.5.0 aesthetic length warning when using
surv.median.line = "hv"or"h"with multiple survival curves (#643) - Fix compatibility with ggplot2 development version (#681): Remove manual class assignment in
theme_survminer()to ensure proper theme object construction - Fix test suite compatibility with ggplot2 development version (#681): Update layer access syntax in tests to support both stable (
$layers) and development (@layers) versions - Fix "Ignoring unknown labels" warnings by conditionally setting legend titles only for aesthetics that are actually used in plots
- Update documentation to recommend
%++%operator instead of+for adding themes to ggsurv objects with ggplot2 v >= 3.5.2 - Fix documentation examples to consistently use
%++%operator intheme_survminer()help
survminer 0.5.0
Minor changes
- R-ADDICT website is no longer live, so updating links in README (#622)
- ggplot2 minimum version is now 3.4.0
- Fixing tidyverse deprecated functions to minimize warnings (@tbaer-c7ks7s #579, and #665):
- dplyr::select_() -> dplyr::select()
- tidyr::gather_() -> tidyr::pivot_longer()
- ggplot2::aes_string() -> ggplot2::aes()
Bug fixes
- Fixing Rd cross-references issue in the documentation (@HenningLorenzen-ext-bayer, #663). RD
\link{}targets missing package added in the following Rd files:- ggadjustedcurves.Rd: coxph.object, coxph
- ggcompetingrisks.Rd: survfit
- ggcoxdiagnostics.Rd: coxph, coxph.object, residuals.coxph, geom_hline, geom_smooth
- ggcoxfunctional.Rd: coxph, Surv, coxph.object, arrangeGrob, grid.arrange
- ggcoxzph.Rd: plot.cox.zph, cox.zph, arrangeGrob, grid.arrange
- ggsurvevents.Rd: Surv, survfit
- ggsurvplot.Rd: grid.arrange
- surv_cutpoint.Rd: theme_classic, grid.arrange
- Fixing issue in the scaling factor for sd in
ggcoxzph()(#534 and #535)
survminer 0.4.9
Minor changes
- A new vignette added to show how to display interaction using ggforest() (#496).
- Since ggplot2 v3.3.0, the function
element_text()issues a warning when vectorized arguments are provided, as in colour = c("red", "green", "blue"). This is a breaking change affecting the functionggsurvtable(). To fix this, the functionggtext::element_markdown()is now used in place ofelement_text()to handle vectorized colors (issue #455 fixed by pull #503).
Bug fixes
survminer 0.4.8
Minor changes
- Maintenance update due to new broom 0.7.0 version by explicitly setting conf.int = TRUE in the call to tidy.coxph from
ggforest()(pull 485).
survminer 0.4.6
New features
- A new function
surv_adjustedcurvesis extracted fromggadjustedcurves. This function calculates adjusted survival curves but do not plot them. Its results may be useful for calculation of median survival or some other statistics. (@pbiecek, #423).
Minor changes
- Adapted to tidyr 1.0.0 (#424
survminer 0.4.5
Minor changes
- Adding variable with a group-agnostic approach (@jennybc, #414
cmprskis no longer needed for survminer installation. The package has been moved from Imports to Suggests. It's only used in documentations (@massimofagg, #394.
Bug fixes
- Now, in
ggflexsurvplot(), the grouping variable can be factor or character vector (@andersbergren , #393 - Bug fixed for plotting confidence intervals for coxph using ggsurvplot (@kharknes, #393
survminer 0.4.4
Minor changes
- ggforest updated to take into account interactions and polynomial or spline terms (@fabian-s, #306, @fabian-s, #388
- Removed unnecessary call to
anova()as requested (@pbiecek, #391
Bug fixes
-
When a factor variable name is the same as one of its level,
ggsurvplot()failed (@KohSoonho, #387). Fixed now. -
ggsurvplot()can now create correctly faceted survival curves (@uraniborg, #254, @BingxinS, #363) -
A typo fixed in the formula for weightened log-rank test (@MarcinKosinski, #336.
-
surv_summary()can now handle the output ofsurvfit(cox.model, newdata)when the optionconf.type = "none"is specified by users (@HeidiSeibold, #335. -
ggadjustedcurves()has now flipped labels forconditional/marginalto mach names from ’Adjusted Survival Curves’ by Terry Therneau, Cynthia Crowson, Elizabeth Atkinson (2015) (@pbiecek, #335.
Survminer 0.4.3
New features
- Now
ggsurvplot()can be used to plot survreg model (@HeidiSeibold, #276, #325 ).
Minor changes
- Now,
ggforest()simply returns a ggplot instead of drawing automatically the plot (@grvsinghal, #267).
Bug fixes
- Now, hiding strata names in risk table work when combining survfits (@krassowski, #317).
- Now,
axes.offsetargument is also applied to risk table (@dmartinffm, #243). - It is now possible to add
ggsurvplotto powerpoint document using ReporteRs even if there is no risk table (@DrRZ, #314).
Survminer 0.4.1
New features
-
New function
ggflexsurvplot()to create ggplot2-based graphs for flexible survival models. -
The function
ggadjustedcurves()handles now argumentmethodthat defines how adjusted curves shall be calculated. Withmethod='conditional'|'marginal'subpopulations are balanced with respect to variables present in the model formula. Withmethod='single'|'average'the curve represents just the expected survival curves.
Major changes
- The function
ggcoxadjustedcurves()is replaced byggadjustedcurves()(#229).
Minor changes
-
The grouping variable to the
ggadjustedcurves()function is now passed as a name (character) of grouping variable not as a vector with values of grouping variable. -
New argument
font.familyinggsurvtable()to change the font family in the survival tables - such as risk, cummulative events and censoring tables. For example font.family = "Courier New" (@Swechhya, #245). -
Now, in
ggsurvplot()the data argument should be strictly provided (@dnzmarcio, #235)
Bug fixes
ggforest()no longer tries to bolt a table full of text to the coefficient plot (@mmoisse, #241), instead the annotations are done via ggplot2::annotate, see example at: @fabian-s, #264
survminer 0.4.0
New features
New options in ggsurvplot()
-
New argument
test.for.trendadded inggsurvplot()to perform a log-rank test for trend. logical value. Default is FALSE. If TRUE, returns the test for trend p-values. Tests for trend are designed to detect ordered differences in survival curves. That is, for at least one group. The test for trend can be only performed when the number of groups is > 2 (#188). -
New argument
add.alladded now inggsurvplot()to add he survival curves of (all) pooled patients onto the main survival plot stratified by grouping variables. Alias of theggsurvplot_add_all()function (#194). -
New argument
combine = TRUEis now available in theggsurvplot()function to combine a list of survfit objects on the same plot. Alias of the ggsurvplot_combine() function (#195). -
The standard convention of ggplot2 is to have the axes offset from the origin. This can be annoying with Kaplan-Meier plots. New argument
axes.offsetadded non inggsurvplot(). logical value. Default is TRUE. If FALSE, set the plot axes to start at the origin (c(0,0)) (#196). -
The function
ggsurvplot()can take a list of survfit objects and produces a list of ggsurvplots (#204). -
New argument
facet.byadded now inggsurvplot()to draw multi-panel survival curves of a data set grouped by one or two variables. Alias of theggsurvplot_facet()function (#205). -
New argument
group.byadded now inggsurvplot()to create survival curves of grouped data sets. Alias of theggsurvplot_group_by()function. -
In
ggsurvplot(), one can specify pval = TRUE/FALSE as a logical value. Now, it's also possible to specify the argumentpvalas a numeric value (e.g.: pval = 0.002), that will be passed to the plot, so that user can pass any custom p-value to the final plot (@MarcinKosinski, #189) or one can specify it as a character string (e.g.: pval = "p < 0001") (@MarcinKosinski, #193). -
New argument
xscaleinggsurvplot(): numeric or character value specifying x-axis scale.- If numeric, the value is used to divide the labels on the x axis. For example, a value of 365.25 will give labels in years instead of the original days.
- If character, allowed options include one of c("d_m", "d_y", "m_d", "m_y", "y_d", "y_m"), where d = days, m = months and y = years. For example, xscale = "d_m" will transform labels from days to months; xscale = "m_y", will transform labels from months to years (#166).
-
New arguments
censor.shapeandcensor.sizeto change the shape and the shape of censors (#186 & #187). -
New argument
conf.int.alphaadded inggsurvplot(). Numeric value specifying fill color transparency. Value should be in [0, 1], where 0 is full transparency and 1 is no transparency.
New functions
-
New function
surv_group_by()added to create a grouped data set for survival analysis. -
New function
ggsurvplot_df()added. An extension to ggsurvplot() to plot survival curves from any data frame containing the summary of survival curves as returned the surv_summary() function. Might be useful for a user who wants to use ggsurvplot for visualizing survival curves computed by another method than the standard survfit.formula function. In this case, the user has just to provide the data frame containing the summary of the survival analysis. -
New function
surv_median()added to easily extract median survivals from one or a list of survfit objects (#207). -
New function
surv_pvalue() added to compute p-value from survfit objects or parse it when provided by the user. Survival curves are compared using the log-rank test (default). Other methods can be specified using the argument method. -
New function
surv_fit() added to handle complex situation when computing survival curves (Read more in the doc: ?surv_fit). Wrapper arround the standardsurvfit() [survival] function to create survival curves. Compared to the standard survfit() function, it supports also:- a list of data sets and/or a list of formulas,
- a grouped data sets as generated by the function surv_group_by,
- group.by option
Major changes
- The
ggforest()function has changed a lot. Now presents much more statistics for each level of each variable (extracted withbroom::tidy) and also some statistics for thecoxphmodel, like AIC, p.value, concordance (extracted withbroom::glance) (#178)
Minor changes
-
Now,
ggcompetingrisks()supports theconf.intargument. Ifconf.int=TRUEandfitis an object of classcumincthen confidence intervals are plotted withgeom_ribbon. -
Now,
ggsurvplot()supports thesurvfit()outputs when used with the argumentstart.time. -
Now, the default behaviour of
ggsurvplot()is to round the number at risk using the optiondigits = 0(214). -
pairwise_survdiff()has been improved to handle a formula with multiple variables (213). -
The argument
colorare updated allowing to assign the same color for same groups accross facets (#99 & #185).- If the number of strata/group (n.strata) = 1, the expected value is the color name. For example color = "blue".
- If n.strata > 1, the expected value is the grouping variable name. By default, survival curves are colored by strata using the argument color = "strata", but you can also color survival curves by any other grouping variables used to fit the survival curves.
For example, in the following script, survival curves are colored by the grouping variable sex in all facets:
library(survminer)
library(survival)
fit <- survfit( Surv(time, status) ~ sex + rx + adhere,
data = colon )
ggsurv <- ggsurvplot(fit, data = colon,
color = "sex",
legend.title = "Sex",
palette = "jco")
ggsurv$plot + facet_grid(rx ~ adhere)-
Now, the function
pairwise_survdiff()checks whether the grouping variable is a factor. If this is not the case, the grouping variable is automatically converted into a factor. -
ggsurvplot(): Now, log scale is used for x-axis when plotting the complementary log−log function (argument `fun = "cloglog") (#171). -
Now, the argument
paletteinggsurvplot()ccan be also a numeric vector of length(strata); in this case a basic color palette is created using the functiongrDevices::palette(). -
The
%+%function insurvminerhas been replaced by%++%to avoid breaking theggplot2::%+%function behavior when using survminer (#199 and #200). -
New argument
funadded inggcoxadjustedcurves()(@meganli, #202). -
The function
theme_classic2()removed.
Bug fixes
-
Columns/Rows are now correctly labeled in
pairwise_survdiff() display (@mriffle, #212). -
Now, the
pairwise_survdiff()function works when the data contain NAs (@emilelatour , #184). -
Now,
ggsurvplot()fully supports different methods, in the survMisc package, for comparing survival curves (#191).