Learn R Programming

SEERaBomb (version 2015.2)

mkDF: Convert seerSet to data.frame for gg-plotting

Description

Creates a data.frame of observed and expected cases for each first and second cancer and treatment.

Usage

mkDF(seerSet,srs)

Arguments

seerSet
seerSet object produced by tsd().
srs
Series. The time series of interest. NULL (default) implies the currently active series, which is the most recent. A number i implies the ith series. A string identifies the series by name (numeric vectors will be coerced to such a string via p

Value

  • A data.frame in long format that can be used by ggplot.

See Also

SEERaBomb-package, mk2D, tsd

Examples

Run this code
library(SEERaBomb)
load("~/data/SEER/mrgd/cancDef.RData") #load in canc
load("~/data/SEER/mrgd/popsae.RData") # load in popsae
canc=canc%>%select(-reg,-recno,-agerec,-numprims,-COD,
          -age19,-age86,-radiatn,-ICD9,-db,-histo3) 
popsa=popsae%>%group_by(db,race,sex,age,year)%>%summarize(py=sum(py)) # sum on regs
pm=seerSet(canc,popsa,Sex="male",ageStart=0,ageEnd=100) #pooled (races) male seerSet
pm=mk2D(pm,secondS=c("AML","MDS"))
brks=c(0,1,5)
firstS=c("NHL","MM")
pm=tsd(pm,brks=brks,trts=c("rad","noRad"),firstS=firstS)
mkDF(pm)

Run the code above in your browser using DataLab