kmPlotWrapper: Create survival plot with numbers at risk.

Description Usage Arguments Examples

View source: R/kmPlotWrapper.R

Description

Create survival plot with numbers at risk.

Usage

1
2
3
4
5
kmPlotWrapper(x, main = "", xlab = "Time", ylab = "Survival probability",
  lty = NULL, col = NULL, pch = NULL, labels = NULL,
  legend = "topright", mark.time = TRUE, cex = 1, cex.legend = 0.7,
  cex.axis = 1, cex.nrisk = 0.8, cex.lty = NULL, times = NULL,
  n.at.risk = FALSE, count.overlap = FALSE, fun = function(x) x, ...)

Arguments

x

An objects of class 'survfit', created by the 'survfit' function.

main

The main title for the plot. ("")

xlab

The x-axis label. ("Time")

ylab

The y-axis label. ("Proportion with event")

lty

The types of lines for the Kaplan-Meier curves. Valid values are 1, 2, 3, ... (1:n)

col

Color codes for the Kaplan-Meier curves. Valid values are 1, 2, 3, ..., with a character string giving the color name (e.g., "red").

pch

Plot symbols used to label the Kaplan-Meier curves. Set to NA if plot symbols are not to be included. Valid values are 1, 2, 3, ...(1:n)

labels

Labels for the number at risk information. Defaults to the same labels retrieved from the survfit object.

legend

The location of the legend. Should be one of "bottomright", "bottom", "bottomleft", "left", "topleft", "top", "topright", "right", "center". Set to FALSE if legend is not to be included. ("topright")

mark.time

Default TRUE; Controls the labeling of the curves. If set to FALSE, no labeling is done. If mark.time is a numeric vector, then curves are marked at the specified time points.

cex

Character expansion for plot symbols. The bigger the value, the larger the characters on the plot. (1)

cex.legend

Character expansion for the legend information. (0.9)

cex.axis

Character expansion for axis labels. (1)

cex.nrisk

Character expansion for number at risk table. (0.8)

cex.lty

The types of lines for the Kaplan-Meier curves (used for legend). Valid values are 1, 2, 3, ... (1:n).

times

The timepoints at which the number of patients at risk should be displayed.

n.at.risk

Logical value specifying whether or not the Number at risk should be included below the plot. (FALSE)

count.overlap

Logical value specifying whether or not to display the number of overlapping censored patients in the plot. (FALSE)

fun

An arbitrary function defining a transformation of the survival curve. See the plot.survfit help for details.

...

Arguments to be passed to the plot.survfit method.

Examples

1
2
3
lung.km <- survfit( Surv(time, status) ~ sex, data=lung)
kmPlotWrapper( lung.km, main="Kaplan-Meier plot", xlab="Time (days)", pch=NA, 
legend="topright", times=seq(0,1000,by=200), n.at.risk=TRUE )

scientific-computing-solutions/sibyl documentation built on May 21, 2019, 8:40 a.m.