ggkmcif2.RdThis function will plot a KM or CIF curve with option to add the number at risk. You can specify if you want confidence bands, the hazard ratio, and pvalues, as well as the units of time used.
ggkmcif2(
response,
cov = NULL,
data,
pval = TRUE,
conf.curves = FALSE,
table = TRUE,
xlab = "Time",
ylab = NULL,
col = NULL,
times = NULL,
type = NULL,
plot.event = 1,
returns = FALSE,
...
)Character vector with time and status column names
Covariate column name (optional)
Input dataframe
Whether to show p-values
Whether to show confidence bands
Whether to include risk table
X-axis label
Y-axis label
colours vector
Numeric vector of times for the x-axis
Plot type ("KM" or "CIF", auto-detected if NULL)
Events to plot
Whether to return list with plot and at risk table
Additional arguments see see ggkmcif2Parameters
Note that for proper pdf output of special characters the following code needs to be included in the first chunk of the rmd knitr::opts_chunk$set(dev="cairo_pdf")