This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(survival) | |
library(survminer) | |
groupSurvival <- function(df, event="OS_IND", time="OS", var=NULL, time.limit=NULL, interval=c("open","close"), | |
method=c("quartile", "mean", "median", "percent", "custom"), percent=NULL, | |
step=20, custom_fun=NULL, group1="High", group2="Low"){ | |
#'@param df a data.frame at leaset including three column which refer to survival info and variable used to | |
#' set group. | |
#'@param event The status indicator, normally 0=alive, 1=dead. Other choices are TRUE/FALSE (TRUE = death) or 1/2 (2=death). | |
#'For interval censored data, the status indicator is 0=right censored, 1=event at time, 2=left censored, 3=interval censored. |