report: Report of descriptive tables and plots.

View source: R/report.R

reportR Documentation

Report of descriptive tables and plots.


This function creates automatically a PDF with the descriptive table as well as availability data and all plots. This file is structured and indexed in the way that the user can navigate through all tables and figures along the document.


report(x, file, fig.folder, compile = TRUE, openfile = FALSE, title = "Report", 
       author, date, perc=FALSE, ...)



an object of class 'createTable'.


character specifying the PDF file resulting after compiling the LaTeX code of report. LaTeX code is also stored in the same folder with the same name but .tex extension. When 'compile' argument is FALSE, only .tex file is saved.


character specifying the folder where the plots corresponding to all row-variables of the table are placed. If it is left missing, a folder with the name file_figures is created in the same folder of 'file'.


logical indicating whether tex file is compiled using texi2pdf function. Default value is TRUE.


logical indicating whether to open the compiled pdf file or not. Currently deprectated. Deafult value is FALSE.


character specifying the title of the report on the cover page. Default value is 'Report'.


character specifying the author/s name/s of the report on the cover page. When missing, no authors appear.


character specifying the date of the report on the cover page. When missing, the present date appears.


logical. Plot relative frequencies (in percentatges) instead of absolute frequencies are displayed in barplots for categorical variable.


Arguments passed to export2latex.


This functions does not work with stratified tables ('cbind.createTable' class objects). To report this class of tables you can report each of its component (see second example from 'examples' section).

In order to compile the tex file the following packages must be available:
- babel
- longtable
- hyperref
- multirow
- lscape
- geometry
- float
- inputenc
- epsfig

See Also

createTable, export2latex, export2csv, export2html, radiograph


## Not run: 


 # example on an ordinary table
res <- createTable(compareGroups(year ~ . -id, regicor), hide = c(sex=1), = '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 <- createTable(compareGroups(year ~ . -id-sex, regicor, subset=sex=='Male'), 
              = 'no')
res.wom <- createTable(compareGroups(year ~ . -id-sex, regicor, subset=sex=='Female'), 
              = 'no')
res <- cbind("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

## End(Not run)

compareGroups documentation built on Nov. 18, 2022, 5:11 p.m.