{
require(ggplot2); require(gridExtra)
data(km.data)
working.df <- km.data
head(working.df)
km.M <- km.plot(parent.df = subset(working.df, SEX== "M"),
centime.col = "CENTIME.DAY",
category.col = "TRTGRP",
category.palette = c("red", "blue"),
at.risk.palette = c("red","blue"),
linetype.palette = c("solid","dotted"),
y.limits=c(0,.01),
y.ticks=seq(0,.01,.005),
x.limits=c(-3,48),
x.ticks=seq(0,48,6))
print(km.M[[1]])
print(km.M[[2]])
grid.arrange(km.M[[1]] + theme(legend.position= "bottom"), km.M[[2]], ncol=1)
comeback <- sync.ylab.widths(list(km.M[[1]]+ theme(legend.position= "bottom"), km.M[[2]]))
grid.arrange(comeback[[1]] , comeback[[2]], ncol=1)
build.page(interior.h = c(.8, .2),
interior.w = c(1),
ncol=1, nrow=2,
interior = list(comeback[[1]],
comeback[[2]]))
}
Run the code above in your browser using DataLab