You are here:
Vanderbilt Biostatistics Wiki
>
Main Web
>
StatComp
>
RS
>
Greport
(revision 22) (raw view)
Edit
Attach
---+ greport Package: Graphical Reporting for Clinical Trials * [[%ATTACHURL%/talk.pdf][Presentation]] * %N% [[GreportVideos][How-to videos]] * [[https://github.com/harrelfe/greport Github repository]] * [[http://cran.r-project.org/web/packages/greport CRAN]] * [[https://github.com/harrelfe/Hmisc/commits/master][Changelog]] ---++ Viewing Reports You must use Adobe Acrobat Reader to view =pdf= files generated by =greport= otherwise pop-ups will not work. Neither pop-ups nor hyperlinks will work if you view documents in a Web browser window. It is recommended that you click on =View ... Page Display ... Single Page= for optimum jumping between hyperlinks, i.e., do not use =Single Page Continuous= mode. ---++ Example Reports * =test.pdf= was generated with !LaTeX variable =poptype= set to 1 to use the !LaTeX =ocgtools= package for pop-up tooltips * =report.pdf= was generated using =poptype= 3 to not use pop-ups but instead to show numbers of analyzed observations as tiny tables in figure captions. This method is more compatible with Mac. * [[http://biostat.mc.vanderbilt.edu/tmp/test.Rnw test.Rnw]] demonstrates more categorical data * [[http://biostat.mc.vanderbilt.edu/tmp/report.Rnw report.Rnw]] contains many longitudinal displays of continuous data, and has the philosophy of the package and software setup instructions including how to annotate variables with =labels= and =units= for pretty output * Resulting =pdf= reports are [[http://biostat.mc.vanderbilt.edu/tmp/test.pdf test.pdf]] and [[http://biostat.mc.vanderbilt.edu/tmp/report.pdf report.pdf]] * Get [[http://biostat.mc.vanderbilt.edu/wiki/pub/Main/Rreport/ssafety.rda ssafety.rda]], the data file for =report.Rnw= ---++ Configuring Project Directory Under your project directory where =knitr= files are stored, created subdirectories =gentex= (to hold !LaTeX code generated by =greport=) and =pdf= (to hold generated graphics). You can use the =setgreportOption= function to name different directories, if you choose. ---++ Special Installation Instructions ---+++ Configuring !LaTeX 1 After installing the =greport= package, run the following command in R: system.file('greport.sty', package='greport') to find =greport.sty=. Copy this file to your !LaTeX package tree. The most convenient location, which doesn't require running =mktexlsr= to update the !LaTeX system, is in your home directory under =texmf/tex=. 1 If using poptype=1, install !LaTeX packages =ocgtools= 1 If using poptype=2, install [[http://biostat.mc.vanderbilt.edu/tmp/tooltip.sty tooltip.sty]] 1 Install !LaTeX package =relsize= 1 To download install !LaTeX packages in Linux, you can obtain =bash= scripts =getlatex= and =getlatexfrom= from DocProcess and run <highlight> getlatex ocgtools </highlight> The !LaTeX =chngpage= package is used by the =exReport= function to allow wide tables to go into the left margin for proper centering within the physical page. ---++++ Special Setup Instructions for Windows * Install the most up-to-date version of Miktex, knitr, Hmisc, and R * Use the Miktex package manager to install listings, ocg-p, ocgtools, relsize if not already installed * Check the latex directory by searching for article.sty on your system and verify that ocgtools has been installed. * You can ignore =ocgtools= if using =poptype= 3 * After installing these packages start the Miktex administration application (this is separate from the package installer). It has a button to update package list. * Within the directory where test is located, create the gentex and pdf directories within the folder. * Knit the test.rnw file. * Open test.tex in pdflatex and compile it 3x. * While running pdflatex may prompt to install additional latex packages that are not currently installed on your system. %N% The next release of the package will include the file =feh.bib= in the top level of where =greport= is installed on your system. Copy that file to the temporary directory where you copy =report.Rnw= so that =pdflatex= can find the bibliographic database. ---+++ Configuring R =test.Rnw= and =report.Rnw= use the =Hmisc= =knitrSet= function to use features of =knitr= for pretty-printing of R code and other things. ---++ Miscellaneous !LaTeX Notes * The !LaTeX =spaper= package simplifies setup for statistical reports and papers - see BiostatisticianResponsibilities * =spaper= uses the =fancyhdr= package for running left (subsection) and right (section) headers. When a section or subsection heading is too long to fit in the space you have at least two recourses: 1 Use =\fancyheadoffset{0.5in}= to allow headings to go 0.5in into margins 1 Break up headings with line breaks. If you don't mind line breaks appearing in the Table of Contents, you can omit the brackets below and keep only the braces and their text. Note the use of =\\= to force a new line. <verbatim> \subsection[This is a Section Heading That is Fairly Long]{This is a Section Heading\\That is Fairly Long} </verbatim> * To create hyperlinks in the final =pdf= report use <verbatim> \usepackage{hyperref} \hypersetup{ bookmarks=false, colorlinks=true, % false: boxed links; true: colored links linkcolor=blue % color of internal links } </verbatim>
Attachments
1
Attachments
1
Topic attachments
I
Attachment
Action
Size
Date
Who
Comment
pdf
talk.pdf
manage
368.2 K
16 Mar 2015 - 09:22
FrankHarrell
greport presentation slides
Edit
|
Attach
|
P
rint version
|
H
istory
:
r25
|
r23
<
r22
<
r21
<
r20
|
B
acklinks
|
V
iew topic
|
Edit WikiText
|
More topic actions...
Topic revision: r22 - 07 Apr 2016,
FrankHarrell
Main
Department Home Page
Biostatistics Graduate Program
Vanderbilt University Medical Center
Main Web
Main Web Home
Search
Recent Changes
Changes
Topic list
Biostatistics Webs
Archive
Main
Sandbox
System
Register
|
Log In
Copyright © 2013-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Vanderbilt Biostatistics Wiki?
Send feedback