[R] Tables with Graphical Representations

Frank E Harrell Jr f.harrell at vanderbilt.edu
Fri Sep 1 16:00:36 CEST 2006


Sam Ferguson wrote:
> Hi useRs -
> 
> I was wondering if anyone out there can tell me where to find R-code  
> to do mixes of tables and graphics. I am thinking of something  
> similar to this:
> http://yost.com/information-design/powerpoint-corrupts/
> or like the excel routines people are demonstrating:
> http://infosthetics.com/archives/2006/08/excel_in_cell_graphing.html
> 
> My aim is to provide small graphics to illustrate numbers directly  
> beside or behind their position in the table. Maybe there is a way to  
> do it with lattice?
> 
> Thanks for any help you may be able to provide.
> Sam Ferguson

The mixtures of tables and graphics we've produced are a bit different 
from the examples you gave but demonstrate the value of combining R and 
LaTeX.  R can produce LaTeX code containing LaTeX picture environments, 
for example.  That's how we put tiny high-resolution histograms inside 
tabular output showing descriptive statistics in the describe function 
and its latex method latex.describe in the Hmisc package.  Charles 
Thomas Dupont is working on a more impressive graphic inside a table by 
adding tiny dot charts showing proportions and confidence limits for 
differences in probabilities to the output produced by the latex method 
for Hmisc's summary.formula function.

An example of the first type may be found in 
http://biostat.mc.vanderbilt.edu/StatGraphCourse under "Mixing Text and 
Graphics" and we'll add an example of the second type soon.

LaTeX offers another approach: tables (matrices) of graphics in the 
tabular environment.

-- 
Frank E Harrell Jr   Professor and Chair           School of Medicine
                      Department of Biostatistics   Vanderbilt University



More information about the R-help mailing list