UNC CSCC 2017-11-16
knitr
+ LaTeX
+ pdflatex
+ Acrobat Readerjavascript
in pdf
files, for pop-ups etc.greport
function for clinical trial reports
pdf
into Word
doesn’t work wellLaTeX
stylingjavascript
htmlTable
package and Hmisc
summaryM
LaTeX
Hmisc
package markupSpecs
list
: large number of translations and helper functionsLaTeX/HTML
translation tables for functionsplotly
Packagejavascript D3
graphics model plotly
ggplotly
function: pass any ggplot2
graphics object through it to get interactivityUsing R
, Rmarkdown
, RStudio
, knitr
, plotly
, and HTML
for the Next Generation of Reproducible Statistical Reports
Frank E Harrell Jr
Professor
Department of Biostatistics
Vanderbilt University School of Medicine
The Department of Biostatistics has two policies currently in effect:
We have succeeded with 1. (mainly using knitr
in R
) and to a large extent with 2. Some biostatisticians have been concerned about interspersing code with the contents of the report. It has also been challenging to copy some PDF report components (e.g., advanced tables) into word processing documents.
Fortunately R
and RStudio
have recently added a number of new features that allow for easy creation of HTML notebooks that are viewed with any web browser. This solves the problems listed above and adds new possibilities such as interactive graphics that appear in a self-contained HTML file to post on a collaboration web server or send to a collaborator. Interactive graphics allow the analyst to create more detail (e.g., confidence bands for multiple confidence levels; confidence bands for group differences as well as those for each group individually) with the collaborator able to easily select which details to view.
I have made major revisions in the R
Hmisc
and rms
packages to provide new capabilities that fit into the R/RStudio
Rmarkdown
HTML notebook framework. Interactive plotly graphics (based on Javascript and D3) and customized HTML output are the main new ingredients. In this talk the rationale for this approach is discussed, and the new features are demonstrated with two statistical reports. A few miscellaneous topics will also be covered, e.g. how to cite bibliographic references in Rmarkdown and how to interface R to citeulike.org for viewing or extracting bibliographic references.
For more information see