View source: R/create.survobj.R
create.survobj | R Documentation |
Create Surv objects from an annotation-matrix with handling for different time units.
create.survobj(annotation = NULL, truncate.survival = 100)
annotation |
A patient annotation matrix (patients = rows) with (at least) columns for survtime, survstat, and survtime.unit |
truncate.survival |
A numeric value specifying survival truncation in years. Defaults to 100 years which effectively means no truncation |
Returns an object of class Surv
Paul C. Boutros
annotation.file <- paste( get.program.defaults()[["test.data.dir"]], "/Breastdata2/patient_annotation.txt", sep = "" ); annotation <- read.table( annotation.file, header = TRUE, row.names = 1, sep = "\t" ); # select the appropriate survtime and survstat variable for this dataset annotation$survstat <- annotation[,'e.dfs']; annotation$survtime <- annotation[,'t.dfs']; annotation$survtime.unit <- annotation[,'t.dfs.unit']; # only keep samples with survival data annotation <- annotation[!is.na(annotation$survstat) & !is.na(annotation$survstat),]; surv.obj <- create.survobj(annotation = annotation);
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.