Cross Validated is a question and answer site for people interested in statistics, machine learning, data analysis, data mining, and data visualization. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to use R to plot out something like this:

Something like this

It would seem possible but highly complex to keep track of the coordinates, width, height, etc. Intuitively it would seem best to treat each cell as a new plot and transform the coordinates for each cell. Is there a way to do this in R?

thanks!

share

locked by whuber Jan 24 at 17:21

This question exists because it has historical significance, but it is not considered a good, on-topic question for this site, so please do not use it as evidence that you can ask similar questions here. This question and its answers are frozen and cannot be changed. More info: help center.

9  
You are looking for sparklines. Searching in R for ??sparkline shows that the packages sparkTable and YaleToolkit could be helpful. – Bernd Weiss Mar 13 '11 at 19:26
    
Looking at YaleToolkit, appears they are using the grid package to create stacked sparklines. Perhaps I can use grid to create the table. – Ming-Chih Kao Mar 13 '11 at 19:52
1  
I'm a bit late to the party on this one, but I recently had a similar question which has been answered over here with some alternative methods for standalone sparklines: http://stackoverflow.com/questions/8337980/r-yaletoolkit-how-to-change-the-font‌​-size-of-tick-labels-on-the-sparklines – Ben Dec 2 '11 at 9:16
    
Check ??sparkline and formattable will helps. – RYO ENG Jan 24 at 15:15
up vote 22 down vote accepted

I initially managed to produce something approaching your original picture with some quick and dirty R code (see this gist), until I discovered that the sparkTable package should do this very much better, provided you are willing to use $\LaTeX$. (In the meantime, it has also been pointed out by @Bernd!)

Here is an example, from help(sparkEPS):

enter image description here

It should not be too difficult to arrange this the way you want.

share
    
Thanks! This is perfect! – Ming-Chih Kao Mar 14 '11 at 5:58

Not the answer you're looking for? Browse other questions tagged or ask your own question.