mplot3_surv: 'mplot3': Survival Plots

View source: R/mplot3_surv.R

mplot3_survR Documentation

mplot3: Survival Plots

Description

Plots survival step functions using mplot3_xy

Usage

mplot3_surv(
  x,
  lty = 1,
  lwd = 2,
  alpha = 1,
  col = NULL,
  mark.censored = TRUE,
  normalize.time = FALSE,
  cex = 1.2,
  xlab = NULL,
  ylab = "Survival",
  main = "Kaplan-Meier curve",
  theme = rtTheme,
  palette = rtPalette,
  plot.error = FALSE,
  error.lty = 2,
  error.alpha = 0.5,
  group.legend = NULL,
  group.title = "",
  group.names = NULL,
  group.side = 3,
  group.adj = 0.98,
  group.padj = 2,
  group.at = NA,
  par.reset = TRUE,
  ...
)

Arguments

x

Survival object / list of Survival objects created using survival::Surv

lty

Integer: Line type. Default = 1. See par("lty")

lwd

Float: Line width. Default = 2

alpha

Float: Alpha for lines. Default = 1

normalize.time

Logical: If TRUE, convert each input's time to 0-1 range. This is useful when survival estimates are not provided in original time scale. Default = FALSE.

xlab

Character: x-axis label

ylab

Character: y-axis label

main

Character: Plot title

theme

Character: Run themes() for available themes

palette

Vector of colors, or Character defining a builtin palette - get options with rtpalette()

group.legend

Logical: If TRUE, place group.names in a legend

group.title

Character: Group title, shown above group names. e.g. if group names are c("San Francisco", "Philadelphia"), group.title can be "City"

group.names

(Optional) If multiple groups are plotted, use these names if group.title = TRUE

group.side

Integer: Side to show group legend

group.adj

Float: adj for group legend. See mtext("adj")

group.padj

Float: padj for group legend See mtext("padj")

group.at

Float: location for group legend. See mtext("at")

par.reset

Logical: If TRUE, reset par setting before exiting.

...

Additional arguments to pass to mplot3_xy

Author(s)

E.D. Gennatas

Examples

## Not run: 
library(survival)
mplot3_surv(Surv(time = lung$time, event = lung$status))

## End(Not run)

egenn/rtemis documentation built on Nov. 22, 2024, 4:12 a.m.