« Two R community milestones | Main | Revolution Newsletter: August 2012 »

August 28, 2012


Feed You can follow this conversation by subscribing to the comment feed for this post.

While Rasmus' plot is very good, it can be improved with ggplot2.

Following the

Date[c(FALSE,(diff(Date) < 0))] <-NA

line, remove everything starting with

to the end of the file.

Then add the following

# Data from Dec 03 1987 to Jan 15 are missing.
# At least Dec 1987 should be removed.

Date[nisdc$Year==1987 & nisdc$Month==12]=NA


# Use 5 day centered average like NSIDC does in the images on www.nsidc.org
nisdc$Ext5d=filter(nisdc$Extent,c(0.2, 0.2, 0.2, 0.2, 0.2),sides=2)

#Stuff Date into data.frame

p=qplot(Date,Ext5d,data=nisdc,color=Year,geom=c("line"),group=Year,alpha=I(8/10),main="Sea Ice Extent 1979-2012 by month\n(colored by year with 2012 in black)",ylab="5 day average extent (millions of sq.km)",xlab="Month of year")

pp = p + geom_line(data=subset(nisdc,Year==2012),color="black",size=2,alpha=0.5)

ppp = pp + coord_cartesian(xlim=c(0.01,11.99)) + scale_x_continuous(breaks=seq(1,12,1)) + opts(axis.text.x = theme_text(hjust=2.5))


This yields a plot showing the annual lines in color that starts with blue in the early 80s and changes to red in the last decade

The comments to this entry are closed.

Search Revolutions Blog

Got comments or suggestions for the blog editor?
Email David Smith.
Follow revodavid on Twitter Follow David on Twitter: @revodavid