Description Usage Arguments Value Author(s) See Also Examples
S3 method for creating plots directly from objects using 'ggplot2', similar to base plot function. The default method is base::plot.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
x |
object to be passed on to the method |
... |
other arguments passed on to the method |
survfit_object |
Object of class 'survfit' |
y_label |
|
x_label |
|
x_ticks |
Ticks for the x-axis. When not specified, the default will do a proposal. |
y_ticks |
Ticks for the y-axis. When not specified, the default will do a proposal based on the 'fun' argument. |
fun |
Arbitrary function defining a transformation of the survival curve. This argument will also influence the y_ticks and y_label if not specified.
|
legend_position |
Specifies the legend position in the plot. Character values allowed are "top" "left" "bottom" "right". Numeric coordinates are also allowed. Default is "right". |
x_unit |
Unit to be added to the x_label (x_label (x_unit)). Default is NULL. |
Object of class ggplot
ggsurvplot
.
Steven Haesendonckx
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | library(survival)
library(dplyr)
library(tidyr)
library(ggplot2)
survfit_object <- vr_KM_est(data = adtte, strata = "TRTP")
## Plot survival probability
vr_plot(survfit_object = survfit_object, fun = "surv")
vr_plot(survfit_object, fun = "pct")
## Plot cumulative hazard
vr_plot(survfit_object, fun = "cloglog")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.