Publication Quality Output
Compared with SAS and SPSS, R's ability to output results for publication quality reports is somewhat rudimentary (although this is evolving).
The R2HTML package lets you output text, tables, and graphs in HTML format. Here is a sample session, followed by an explanation.
# Sample Session
extension="html", echo=FALSE, HTMLframe=TRUE)
HTML.title("My Report", HR=1)
HTML.title("Description of my data", HR=3)
HTML.title("X Y Scatter Plot", HR=2)
Once you invoke HTMLStart( ), the prompt will change to HTML> until you end with HTMLStop().
The echo=TRUE option copies commands to the same file as the output.
HTMLframe=TRUE creates framed output, with commands in the left frame, linked to output in the right frame. By default, a CSS file named R2HTML.css controlling page look and feel is output to the same directory. Optionally, you can include a CSSFile= option to use your own formatting file.
Use HTML.title() to annotate the output. The HR option refers to HTML title types (H1, H2, H3, etc.) . The default is HR=2.
HTMLhr() creates a horizontal rule.
Since several interactive commands may be necessary to create a finished graph, invoke the HTMLplot() function when each graph is ready to output.
The RNews article The R2HTML Package has more complex examples using titles, annotations, header and footer files, and cascading style sheets.
Sweave allows you to imbed R code in LaTeX, producing attractive reports if you know that markup language.
The SWordInstaller package allows you to add R output to Microsoft Word documents.
The R2PPT provides wrappers for adding R output to Microsoft PowerPoint presentations.