R/plot.survtype.R

Defines functions plot.survtype plot

Documented in plot plot.survtype

plot <- function(object, ...) UseMethod("plot")

plot.survtype <- function(object, ...)
{
  Time <- object$time
  Status <- object$status
  Group <- object$cluster
  surv.data <- data.frame(Time, Status, Group)
  fit <- object$fit
  if(!is.null(object$subset))
  {
    Time <- Time[object$subset]
    Status <- Status[object$subset]
    Group <- Group[object$subset]
    surv.data <- data.frame(Time, Status, Group)
  }
  ggsurvplot(fit, data = surv.data, ...)
}

Try the survtype package in your browser

Any scripts or data that you put into this service are public.

survtype documentation built on Nov. 8, 2020, 7:24 p.m.