Skip to content

Instantly share code, notes, and snippets.

View PhilipPallmann's full-sized avatar

Philip Pallmann PhilipPallmann

  • Cardiff University
  • Cardiff, UK
View GitHub Profile
@PhilipPallmann
PhilipPallmann / ggsurv.R
Last active August 29, 2015 14:03 — forked from mattbaggott/ggsurvival.R
Draw ggplot2-style Kaplan-Meier curves (slightly modified version of mattbaggott/ggsurvival.R).
ggsurv <- function(f.survfit, f.CI="default", f.shape=3){
require(ggplot2, quietly=TRUE)
# initialise frame variable
f.frame <- NULL
# check if more then one strata
if(length(names(f.survfit$strata)) == 0){
# create data.frame with data from survfit