Plot the event plot or the cumulative sample mean (CSM) function for an reSurv
object.
# S3 method for reSurv plot(x, CSM = FALSE, order = TRUE, control = list(), ...)
x | an object of class |
---|---|
CSM | an optional logical value indicating whether the cumulative sample mean (CSM) function will be plotted instead of the event plot (default). |
order | an optional logical value indicating whether the event plot (when |
control | a list of control parameters. See Details. |
... | graphical parameters to be passed to methods.
These include |
A ggplot
object.
The argument control
consists of options with argument defaults to a list with the following values:
customizable x-label, default value is "Time".
customizable y-label, default value is "Subject" for event plot and "Cumulative mean" for CSM plot.
customizable title, the default value is "Recurrent event plot" when CSM = FALSE
and
"Sample cumulative mean function plot" when CSM = TRUE
.
customizable label for terminal event, default value is "Terminal event".
customizable legend title for recurrent event, default value is "Recurrent events".
customizable label for recurrent event type, default value is NULL
.
between 0 and 1, controls the transparency of points.
The xlab
, ylab
and main
parameters can also be passed down without specifying a control
list.
set.seed(1) dat <- simSC(30, c(-1, 1), c(-1, 1)) reObj <- with(dat, reSurv(Time, id, event, status)) ## Event plots: ## Default labels plot(reObj)## User specified labels plot(reObj, control = list(xlab = "User xlab", ylab = "User ylab", main = "User title"))