# NOT RUN {
# }
# NOT RUN {
require(compareGroups)
data(regicor)
# example on an ordinary table
res <- createTable(compareGroups(year ~ . -id, regicor), hide = c(sex=1), hide.no = 'no')
report(res, "report.pdf" ,size="small", title="\Huge \textbf{REGICOR study}",
author="Isaac Subirana \\ IMIM-Parc de Salut Mar")
# example on an stratified table by sex
res.men <- createTable(compareGroups(year ~ . -id-sex, regicor, subset=sex=='Male'),
hide.no = 'no')
res.wom <- createTable(compareGroups(year ~ . -id-sex, regicor, subset=sex=='Female'),
hide.no = 'no')
res <- cbind("Men"=res.men, "Wom"=res.wom)
report(res[[1]], "reportmen.pdf", size="small",
title="\Huge \textbf{REGICOR study \\ Men}", date="") # report for men / no date
report(res[[2]], "reportwom.pdf", size="small",
title="\Huge \textbf{REGICOR study \\ Women}", date="") # report for wom / no date
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab