Description Usage Arguments Value Examples
View source: R/survminertools.R
Uses ggsurvplot
from the survminer package to create publication-ready plots.
1 | kaplan_meier_plot(..., mapped_plot_args = list(), p_lessthan_cutoff = 0.001)
|
... |
One or many SurvivalAnalysisResult objects as returned by
|
mapped_plot_args |
Optionally, if given n objects to plot, a named list of vectors of size n. The name is an argument names passed to ggsurvplot. The elements of the vector will be mapped 1:1 to each object. This allows to perform batch plotting where only few arguments differ (e.g. titles A, B, C...) between the plots. |
p_lessthan_cutoff |
The lower limit below which p value will be displayed as "less than". If p_lessthan_cutoff == 0.001, the a p value of 0.002 will be displayed as is, while 0.0005 will become "p < 0.001". |
If given one result to plot, one ggsurvplot object; if given more than one result, a list of ggsurvplot objects.
1 2 3 4 5 6 7 8 | library(magrittr)
library(dplyr)
survival::aml %>%
analyse_survival(vars(time, status), x) %>%
kaplan_meier_plot(break.time.by="breakByMonth",
xlab=".OS.months",
risk.table=TRUE,
ggtheme=ggplot2::theme_bw(10))
|
Attaching package: ‘dplyr’
The following objects are masked from ‘package:stats’:
filter, lag
The following objects are masked from ‘package:base’:
intersect, setdiff, setequal, union
Warning message:
Vectorized input to `element_text()` is not officially supported.
Results may be unexpected or may change in future versions of ggplot2.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.