Skip to content
Prev 43428 / 398506 Next

How to generate a report with graphics and tables?

Just to expand on an earlier suggestion:
> clipboard into Powerpoint.
...
package, too) to write the `report' in HTML.
R2HTML is not (yet) as far along as Sweave, but depending on how much
sympathy you have for your clients, html can be a very nice solution. An
important requirement for many reports is that computer-naive clients be
able to edit and copy from the reports to an MS application, preferably
without severe font and formatting problems and without needing to
install/understand <foo>2<bar> type applications. See comments to this
effect in the recent R2HTML article by the package author, Eric Lecoutre in
the most recent R News (vol 3/3). As Andy noted, xtable is nice to use in
conjunction with R2HTML (just write a little xtable method like the one
following this message):

In particular, a naive user viewing the html file with Internet Explorer (I
know v. 5.5 or greater will work) will have an option, under the File menu
to "Edit with Microsoft Word for Windows". This assumes they have set MS
Word as their HTML editor within IE. It also assumes some minimal formatting
requirements for the HTML file (but you can worry about this, the client
won't have to). 

I find this solution keeps everyone happy:
1. I can auto-generate text source for my documents;
2. clients without proprietary software can view the report; 
3. clients with standard MS software but without a clue can easily edit and
copy. 

Cheers,
Jim 

HTML.xtable <- function(x, file = .HTML.file, append = TRUE) {
  sink(file = file, append = append)
  print(x, type = "html")
  sink()
}

James A. Rogers 
Manager, Nonclinical Statistics
PGR&D Groton Labs
Eastern Point Road (MS 8260-1331)
Groton, CT 06340
office: (860) 686-0786
fax: (860) 715-5445
 










LEGAL NOTICE\ Unless expressly stated otherwise, this messag...{{dropped}}