kmplot_ticks: Add ticks to 'kmplot'

kmplot_ticksR Documentation

Add ticks to kmplot

Description

Add tick marks to a kmplot representing a specific event, what, occurring within a variable, by_var.

Usage

kmplot_ticks(
  object,
  data = eval(object$call$data),
  by_var,
  what,
  y = 0,
  time,
  event,
  strata,
  col = NULL,
  pch = NULL,
  ...
)

Arguments

object

an object of class survfit

data

the data set used to fit s which should also contain by_var and optionally time, event, and strata; kmplot_ticks will attempt to select these variables based on the call to survfit

by_var, what

a variable, by_var in data for which tick marks are to be placed at each occurrence of what

y

the y-coordinate(s) for each point, recycled as needed

time, event, strata

(optional) variables used to fit s

col

a vector of colors (one for each strata level of s) for tick marks; note these colors should match the curves of the survival plot

pch

a vector of plotting characters to distinguish censoring and events

...

additional arguments passed to points

See Also

kmplot; kmplot_by

Examples

library('survival')
s <- survfit(Surv(futime, fustat) ~ rx, ovarian)

kmplot(s, add = TRUE)
kmplot_ticks(s, by_var = 'resid.ds', what = 1)
kmplot_ticks(s, by_var = 'resid.ds', what = 2, pch = '*', y = 0.05)


raredd/rawr documentation built on May 19, 2024, 1:02 p.m.