Dynamic graphics Gapminder: http://www.gapminder.org/ Hans

advertisement
Dynamic graphics
Gapminder: http://www.gapminder.org/
Hans Rosling: http://www.gapminder.org/videos/#.U9lzgvldXDt
(all the videos are very good. The 1 hour documentary "The Joy of Stats" is really interesting)
Ggobi (Demo using Rggobi package add-in)
http://www.ggobi.org/
Implementations for PC, Mac, Linux
R package "rggobi" that interfaces with R, available on CRAN.
Note: Ggobi is still maintained but does not seem to be very active. "Cranvas" may be the next
incarnation, but currently is not ready for prime time.
There is a good book:
Interactive and Dynamic Graphics for Data Analysis: With Examples Using R and GGobi. Dianne Cook
and Deborah F. Swayne
ggobi demo:
library(ISLR)
library(rggobi)
ggobi(Advertising)
load(url('http://www.mathstat.dal.ca/~aarms2014/StatLearn/data/har.RData'))
source("http://www.mathstat.dal.ca/~aarms2014/StatLearn/R/A2funs.R")
for (i in 7:18)
har[,i]=mytrim(har[,i],.02)
set.seed(7)
mysample = sample(nrow(har),500)
smallhar = har[mysample,-(1:6)]
table(smallhar$class)
sitting sittingdown
standing
144
34
148
standingup
41
walking
133
# we might instead try to generate equal size samples
mysample = NULL
for (i in levels(har$class))
mysample = c(mysample,sample((1:nrow(har))[har$class==i],100))
table(har$class[mysample])
sitting sittingdown
standing standingup
walking
100
100
100
100
100
smallhar = har[mysample,-(1:6)]
ggobi demo, continued
ggobi(smallhar)
hgg = ggobi_get()$smallhar
table(glyph_colour(hgg))
table(glyph_size(hgg))
glyph_colour(hgg) = smallhar$class
glyph_size(hgg) = 6
# Things to try - 3d rotation, grand tour, grand tour with sphering.
# code below isn't really necessary
# but you can set the symbol and the labels
table(glyph_type(hgg))
glyph_type(hgg) = smallhar$class
glyph_type(hgg) = 6
ids(hgg) = smallhar$class
We'll also explore the "places.xml" data that are included with ggobi and can be loaded directly from the
ggobi program.
That demo shows data from the "places rated almanac", which gives quality of life variables for 329 US
cities. There is also longitude and latitude, so we can examine spatial patterns.
The demo will show the benefit of interaction, brushing, and examining multiple views of the data at the
same time.
As I'm writing this I have also discovered Hadley Wickham has authored R packages for model
visualization that use ggobi as their front end:
http://had.co.nz/model-vis/
Some people to follow / watch / read:
The statistical graphics communith has lots of interestng work being done. Much of it is quite readable.
Below is a highly biased list of folks I find interesting to watch:
1. Andrew Gelman, statistician @ Columbia U (blog at http://andrewgelman.com/)
- very prolific, lots of interesting ideas
2. Ross Ihaka, one of the inventors of "R" teaches a course on graphics. He's got a section on visual
perception, for example. See
https://www.stat.auckland.ac.nz/~ihaka/120/
3. Hadley Wickham (http://had.co.nz/) - Rice University & Chief Scientist @ Rstudio
ggplot, rggobi interface, plyr classifly and friends (haven't had time to check them out yet), and lots more
4. Amanda Cox, NY Times
Slides from a talk:
http://www.slideshare.net/openjournalism/amanda-cox-visualizing-data-at-the-new-york-times
Interesting talk (video):
http://women2.com/2011/12/07/amanda-cox-developing-infographics-at-the-new-york-times/
Annotation and editing are critical
"Nothing really important is ever headlined "Here is some data. Hope you find something interesting."
http://www.nytimes.com/interactive/sports/olympics/olympics-interactives.html?ref=science#tab1
Edward Tufte:
http://www.edwardtufte.com/
"The visual display of quantitative information"
"Envisioning information"
"Visual explanations"
Other tidbits:
http://rcharts.io/
http://shiny.rstudio.com/ - write your own web interface to a dynamic R graph.
R-bloggers for example
http://www.r-bloggers.com/oldies-but-goldies-statistical-graphics-books/
Download