Learn R Programming

survMisc (version 0.5.0)

plotSurv: Plot a Surv object.

Description

Plot a Surv object.

Usage

## S3 method for class 'Surv':
plot(x, l = 3, ...)

Arguments

x
A Surv object
l
length of arrow. Length is l / nrow(x)
...
Additional arguments. These are passed to as ... (an ellipsis) to the following functions, respectively: [object Object],[object Object]

Value

  • A graph (base graphics). The type of graph depends on the type of the Surv object. This is given by attr(s, which="type") :
  • countingLines with an arrow pointing right if right censored.
  • rightLines with an arrow pointing right if right censored.
  • leftLines with an arrow pointing left if left censored.
  • intervalIf censored: [object Object],[object Object] If not censored: [object Object],[object Object]

See Also

?graphics::arrows

?graphics::segments

Examples

Run this code
df0 <- data.frame(t1=c(0, 2, 4, 6, NA, NA, 12, 14),
                  t2=c(NA, NA, 4, 6, 8, 10, 16, 18))
s5 <- Surv(df0$t1, df0$t2, type="interval2")
plot(s5)

Run the code above in your browser using DataLab