Using R to Compare Hurricane Sandy and Hurricane Irene

November 3, 2012

(This article was first published on Statistical Research » R, and kindly contributed to R-bloggers)

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.


sandy = read.table(file="", skip=3,fill=TRUE)
irene = read.table(file="",skip=3,fill=TRUE)
colnames(sandy) = c("Advisory","Latitude","Longitude","Time","WindSpeed","Pressure","Status")
colnames(irene) = c("Advisory","Latitude","Longitude","Time","WindSpeed","Pressure","Status")

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') <- map("state", region = state.list, interior = FALSE, xlim=xlim, ylim=ylim)
map("state", region = state.list, boundary = FALSE, col="gray", add = TRUE,xlim=xlim)

text(x=sandy$Longitude,y=sandy$Latitude,col='dark green',labels=sandy$Pressure,adj=c(-0.9),cex=0.5)

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'))




To leave a comment for the author, please follow the link and comment on his blog: Statistical Research » R. offers daily e-mail updates about R news and tutorials on topics such as: visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.