STAT 133 Homework 4: Custom Graphics
Napoleon's March
Due: Friday, 9 Apr

One of the most famous statistical graphics is Minard's figurative map of the succesive losses of men in the French army during the Russian campaign, 1812-1813.

From Michael Friendly's website Re-Vision's of Minard.

Wilkinson (The Grammar of Graphics, Chapter 15) digitized the origial graphic, anlayzed the notations, and located geographic landmarks to produce the data behind Minard's graphic. These data consist of three tables:

• City data consisting of the longitude, latitude, and names of twenty cities.
• Temperature data consisting of the longitude, temperature (degrees Celsius) and date (month and day) the temperature was recorded.
• Army data consisting of the longitude, latitude, troups (count), direction (A =advance, R=retreat), and subgroup of the army (1, 2, 3).
• pathPlot R-program. Load this into your R session and call pathPlot() after you have set up the data region.

From this data, Wilkinson produced the following graphic.

From Michael Friendly's website Re-Vision's of Minard.

Your assignment is to use R to reproduce Wilkinson's graphic. To help you in this task, we use Wilkinson's grammar to describe his rendition of the Minard graphic of Napoleon's March.

• TRANS: date = Use longitude to linearly interpolate the missing date in the temperature dataset.
• TRANS: days = Use first differences to determine the number of days between dates of recorded temperatures. (Actually this transformation has been done for you, and included in the data table as the variable Days).
• FRAME: longitude * latitude
• GRAPH: point(label points of longitude and latitude with the city names)
• GRAPH: path(use longitude and latitude to draw a path where the width is determined by the survivors, the color by the direction, and split according to the group) Note that when the number of survivors is very small, the path does not shrink proportionally in order to maintain visibility. In fact, all you need to do here is use the pathPlot function described above).
• GUIDE: legend for direction
• FRAME: longitude * temperature
• COORD: shrink dimension 2 to 0.2 the usual
• COORD: translate dimension 2 by -0.5, and use the interval from 0 to -30.
• GRAPH: line(labeled with date and where the granularity is determined by days)
• GUIDE: label axis1 with "Longitude"
• GUIDE: label axis2 with "Temperature" on the right, and add horizaontal lines at -10 and -20.

Your assignment should include the R code you used to create the graphic (in a plain text file) and a signed graphic (in pdf format). To sign your graphic, put an inconspicuous, unique identifier somewhere on the graph (include the code to do this in your submission).

Please email your assignment to Gang Liang (liang at stat.berkeley.edu) by midnight Friday, April 9.