[R] including tabular information with a plot in R Graphics

Jim Lemon jim at bitwrit.com.au
Fri Mar 6 08:12:15 CET 2009


R User R User wrote:
> Hi all,
> I have a presentation problem that I cannot find a solution to in the
> documetnation.
> I have a nice barplot. Below this I would also like a table with some
> information relating to the plot.
> My idea was to have the plot and table on the same graphics window so I can
> output them as an image file for a report.
>
> Does anybody know how to include tabular information from a dataset or table
> into the graphics device?
> Is there a better/more correct way to output tables and graphics to a single
> file?
>
>   
Hi Richie,
You can add a table to a plot with "addtable2plot" in the plotrix 
package, as well as the other suggestions already offered. This places a 
table on the plot itself. If you want to mix plots and tables in an 
output listing, the prettyR package includes "htmlize" and "R2html" to 
convert the output of a script into HTML, and "delim.table" that can put 
HTML tables into the same file.

Jim




More information about the R-help mailing list