R/survfit.rpsftm.R

Defines functions survfit.rpsftm

Documented in survfit.rpsftm

#' Function to apply survfit method to rpsftm objects
#' 
#' @title survfit() method for rpsftm objects
#' @name survfit.rpsftm
#' @export
#' @inheritParams summary.rpsftm
#' @return a survfit object.
#' @seealso \code{\link[survival]{survfit}}
#' @author Simon Bond
#' 


survfit.rpsftm <- function(object, ...){
  if(class(object)[2] != "coxph"){
    stop(paste( "No applicable method for 'survfit' applied to an object of class", class(object)[2],"\n")
    )
  }else{
    coxfit <- attr( object$ans$f.root, "fit")
    survival::survfit(coxfit, ...=...)
  }
  
}

Try the rpsftm package in your browser

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

rpsftm documentation built on Nov. 2, 2023, 6:07 p.m.