15

I'm looking to create a static dashboard viewable in a web browser. And I'd like to create something like what Stephen Few does in his book Information Dashboard Design. (see example at bottom)

  1. Ggplot2: Shouldn't be any issue producing the graphs below, right?
  2. Dashboard Layout: Is grid suitable? Or should I lay things out in html/css?

If grid can do this easily enough, do you know of any good resources for learning how to us it? I've read the manual but I'm not finding it too helpful. I've seen the LearnR blog's ggplot2 sales dashboard (it uses grid) and I'm having trouble understanding the grid and layout part of things.

dasboard sample http://img251.imageshack.us/img251/1029/fewciodashboard800.png

Richie Cotton
  • 118,240
  • 47
  • 247
  • 360
user246211
  • 1,137
  • 1
  • 13
  • 23
  • 1
    IMO it would be easier to just produce the individual plots then arrange things using HTML/CSS – Amro Feb 04 '10 at 21:59

4 Answers4

5

See http://learnr.wordpress.com/2009/04/09/ggplot2-sales-dashboard/ for an example with code.

hadley
  • 102,019
  • 32
  • 183
  • 245
  • I've been looking at that and it looks good. I think I'd need a much more complex grid layout to reproduce the image above. But I'm having trouble learning how to use grid. Got any other recommendations or examples? – user246211 Feb 04 '10 at 06:34
4

I think your html/css-direction might be a really smart move.

It might be easier to get an awesome layout using using Open Office draw and just link to the images, checking off the link box when insterting them for the first time. Open Office supports export to pdf making it usefull for reporting.

Even if it was straight forward to programaticly create a stunning document layout in R, I'm not sure it would be worth the time and effort.

Regards

tovare
  • 4,027
  • 5
  • 29
  • 30
3

I would suggest also having a look at the brew package, as in this example on the learnr blog.

Shane
  • 98,550
  • 35
  • 224
  • 217
  • i agree, use brew and R to create html tables etc, i still wonder about server-side v client side graphics (recc: protovis). Then just use css or a js framework to style appropriately – Dan Feb 05 '10 at 19:12
  • I agree, and made this point here: http://stackoverflow.com/questions/2162131/how-can-i-learn-to-create-beautiful-infographics-with-connection-to-my-r-knowled/2162215#2162215. R may not be the right choice for web graphics in the long run, although that's not to say that those other packages can't be integrated (e.g. Rprotovis?). – Shane Feb 05 '10 at 19:15
2

A few years later, there are options available for dashboards and layouts with R.

  • For making grids in R, ggplot2's facet_wrap and facet_grid are excellent.
  • Shiny allows you to make web apps and dashboards with R. Shiny handles the HTML, CSS, and JavaScript for you. It's on CRAN.
  • To use ggplot2 to make an interactive Shiny dashboard with d3.js, you can connect to Plotly's ggplot2 figure converter. Here is a tutorial with code examples. Your published apps let you zoom, toggle, filter, pan, and see data on the hover, e.g.:

    enter image description here

    Disclaimer: I'm on the Plotly team.
Mateo Sanchez
  • 1,604
  • 15
  • 20