R/kmPlot.formula.R

Defines functions kmPlot.formula

Documented in kmPlot.formula

kmPlot.formula <- function(formula, data, ...) {
  call <- match.call
  m <- match.call(expand.dots = FALSE)
  m[[1]] <- as.name("model.frame")
  m$... <- NULL
  m <- eval(m, parent.frame())
  Y <- model.extract(m, "response")
  if (!inherits(Y, "Surv")) {
    stop("The left-hand side of the formula must be a 'Surv' object.")
  }
  times <- Y[, 1]
  cens <- Y[, 2]
  kmPlot(times, cens, ...)
}

Try the GofCens package in your browser

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

GofCens documentation built on Oct. 30, 2024, 9:13 a.m.