Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Having just lived through two back to back hurricanes (Irene in 2011 and Sandy in 2012) that passed through the New York metro area I was curious how the paths of the hurricanes differed.  I worked up a quick graph in R using data from Unisys.  The data also includes wind speed and barometric pressure.

library(maps)
library(maptools)
library(rgdal)

sandy$WindSpeedColor <- 'blue' sandy$WindSpeedColor[sandy$WindSpeed >= 75] <- 'red' irene$WindSpeedColor <- 'blue'
irene$WindSpeedColor[sandy$WindSpeed >= 75] <- 'red'
xlim <- c(-88,-65)
ylim <- c(25,48)

state.list <- c('new york','new jersey','virginia','massachusetts','connecticut','delaware','pennsylvania','maryland','north carolina','south carolina','georgia','florida',
'new hampshire','maine','district of columbia','west virginia','vermont')
my.map <- map("state", region = state.list, interior = FALSE, xlim=xlim, ylim=ylim)
map("state", region = state.list, boundary = FALSE, col="gray", add = TRUE,xlim=xlim)

lines(x=sandy$Longitude,y=sandy$Latitude,col="black",cex=0.75)
points(x=sandy$Longitude,y=sandy$Latitude,col=sandy$WindSpeedColor,pch=15,cex=0.9) text(x=sandy$Longitude,y=sandy$Latitude,col='dark green',labels=sandy$Pressure,adj=c(-0.9),cex=0.5)

lines(x=irene$Longitude,y=irene$Latitude,col="black",cex=0.75)
points(x=irene$Longitude,y=irene$Latitude,col=irene$WindSpeedColor,pch=15,cex=0.9) text(x=irene$Longitude,y=irene$Latitude,col='light green',labels=irene$Pressure,adj=c(-0.9),cex=0.5)

title("Path of Hurricane Sandy (2012) and Hurricane Irene (2011)\nwith Wind Speed and Barometric Pressure")
legend('topleft',c('Tropical Storm Wind Speeds','Hurricane Wind Speeds'),pch=15, col=c('blue','red'))

box()