On Mon, 21 Sep 2009, David Winsemius wrote:


On Sep 21, 2009, at 5:52 PM, Martin Batholdy wrote:

I use xtable to convert data.frames to html tables.
But when I use the print-command I always get the whole output printed
even if I just want to save the html table into a variable;

table <- print(xtable(CERAT), type="html")


How can I suppress that output is printed?

Perhaps by diverting it somewhere else? (after the example in xtable's help page)

capture.output(print(tli.table, type="html"), file="HTout.html")

R is not an HTML editor, so it would seem less than intuitive to send it to a character variable. It would not work to assign the value of capture.output since that is an invisible NULL.


If that were true, capture.output() would be pretty useless.  The returned 
value is NULL if the file= argument is specified, otherwise it is the captured 
output.

         -thomas

Thomas Lumley                   Assoc. Professor, Biostatistics
tlum...@u.washington.edu        University of Washington, Seattle

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to