Blog: 28 May 2012

How many veterans are there? Memorial Day data

The short answer is there are about 21 million American Veterans as of 2012. As a total, that's about 6.8% of the US population.

For comparison, that's about...

American Beards Over Time: Time Series in R (Part I)

If you use R for time series analysis, chances are you've used Robert J. Hyndman's excellent forecast tools.  I recently stumbled on his time series data library where I found just the data set I've been looking for to show some R time series plotting tricks:

http://robjhyndman.com/tsdldata/roberts/beards.dat

It's the percentage of American men with full beards reported annually.  Nothing serious here, but absurdly perfect for a set of posts to share a couple things that took me a while to learn when plotting in R.

What you'll learn

  • How to grab data from a plaintext source on the web, stripping header information
  • How to convert a list of data with a known start time and end time into an xts time series object
  • How to convert xts to a data.frame for plotting in ggplot2
  • Aesthetics for red data points with dotted line interpolation
  • How much American beardfulness there was in the late 19th century and early 20th.
Subscribe to Blog: 28 May 2012