This is the first in a multi-part series that will explore some of the visualizations that are contained in Edward Tufte's "The Visual Display of Quantitative Information" in R by using the webvis package (which provides a wrapper for Protovis).
This first post will reproduce one of the most famous early graphics. My goal is to use these posts to elaborate some important graphical concepts while also experimenting with and enhancing the webvis package. I invite others to reproduce these using ggplot.
William Playfair is often considered the founder of statistical graphics. His plot of wheat prices vs. wages and monarchies was originally posted in 1822 in "Letter on our agricultural distresses, their causes and remedies; accompanied with tables and copper-plate charts shewing and comparing the prices of wheat, bread and labour, from 1565 to 1821", addressed to the Lords and Commons, London (the entire original letter is available on Google books).
Playfair intended to demonstrate that “never at any former period was wheat so cheap, in proportion to mechanical labour, as it is at the present time.”
Playfair's Wheat in R
The data is available in the HistData package, as well as the webvis package itself. This is a relatively complicated graphic since it has multiple layers. The simplest way to walk through this visualization is to use the webvis demo, which follows the related Protovis example.
To run this, install webvis:
Then run the demo:
It can help to compare the code to the original Protovis example. The final result is parsed in a browser (doesn't work in old versions of IE, but will work in IE9).