Skip to content

Instantly share code, notes, and snippets.

# Read in the data without any processing
data <- read.table('http://www.dartmouth.edu/~chance/teaching_aids/data/birthday.txt',as.is=1)
data[,1] <- as.Date(data[,1],format='%m/%d/%y')
plot(data,xlab='Date',ylab='Live Births',main='Live Births by Date')
# save the plot
png('dob-distribution.png',width=700)
plot(data,xlab='Date',ylab='Live Births',main='Live Births by Date')
dev.off() # write it