Learn R Programming

cohorttools (version 0.1.6)

plotratetable: Function makes plot(s) from ratetable

Description

Function makes plot(s) from ratetable

Usage

plotratetable(rt, RR = FALSE)

Value

ggplot object, or list if multiple variables in rate table

Arguments

rt

Rate table produced by function mkratetable

RR

Boolean, if TRUE rate ratios plotted

Examples

Run this code
library(ggplot2)
library(survival)
tmp.lt1<-mkratetable(Surv(time,status)~ ph.ecog,data=lung,add.RR = FALSE)
plotratetable(tmp.lt1)
tmp.lt2<-mkratetable(Surv(time,status)~ sex+ph.ecog+cut(age,4),data=lung,add.RR=TRUE,lowest.N=1)
plotratetable(tmp.lt2,TRUE)

Run the code above in your browser using DataLab