In this post I describe an R script that retrieves monthly global temperature anomaly data from 5 sources and consolidates the data into a single CSV file. I then post the consolidated file in an on-line Google spreadsheet so that users can download the data and conduct their own global temperature trend analysis.
Global Climate Trends
There are many blogs and web sites (small sample: 1, 2, 3, 4, 5, 6) with multiple opinions on global climate trends. Some sites are data oriented and others are opinion oriented. What is a charter to think?
My advice, take a look at the data for yourself. As an Excel or R charter, why not analyze it yourself to get a better appreciation for what is going on.
To help you get started, I’ve developed a consolidated monthly CSV file that presents the 5 major global land and ocean temperature anomaly data series: GISS, NOAA, HADCrut3, RSS and UAH. This page gives some additional information.
Google Spreadsheet
Here’s the link to my Google spreadsheet of the monthly data. I’ve tried to simply download and consolidate the raw data as provided by the source sites. My goal is to present the data in a simple CSV format so that Excel, R and other software charters can evaluate the trends without having to struggle through the source data re-formatting process.
R Script
The source files are a little messy from a charting standpoint, each needs its own reformat procedure. I’ve posted my R script at this link.
Update
Peter Gallagher submitted a comment adding a ggplot2 script for the test plot I made at the end of my R script. Since it took me way to long to get the basic data handling done, I was burned out and just put together an ugly chart of the 5 data series to make sure the data transfer worked.
Peter’s ggplot2 snipet is just great. Thanks Peter! Here’s what it looks like.



13 responses so far ↓
Global Sea Surface Temperature Trends (1850-2009)/ « Charts & Graphs with R // September 4, 2009 at 9:05 AM |
[...] a number of land & ocean temperature anomaly trend charts in previous posts, including: here, here, here and here. These posts have dealt with atmospheric temperature anomalies. In this post, I [...]
RJames // July 20, 2009 at 4:40 AM |
This will be excellent. I already plot some of these, but having access to all five will be very helpful. I haven’t tested it yet. Hope it’s easy to do.
from Peru // July 15, 2009 at 10:31 PM |
How could I put those .txt data into an EXCEL table?
PD: Excuse me for the “ffffff”. I was just ckecking that you can actually receive my post.
Kelly // July 16, 2009 at 8:12 AM
You can easily download the Google spreadsheet:
1. With Google spreadsheet open, press File (left side of menu bar)
2. Choose Export – this will give you 6 choices, including csv, txt, and xls
Dan Murray // July 10, 2009 at 9:34 PM |
Nice work with the Tableau visualization Joe.
Peter Gallagher // July 10, 2009 at 8:01 PM |
Hi Kelly,
Many thanks for this. A very useful piece of work (the R script, especially).
I’ve found the best way to use the data downloaded is to add a few lines to the bottom of the script in place of the current ‘test’ plot:
# convert from wide to long format
myDat<-melt(consol_lo, id="yr")
# display in a faceted grid with variable scales for each facet
qplot(yr, value, data=myDat, geom="line", group=variable) + facet_grid(variable ~ ., scale = "free_y")
Kelly // July 10, 2009 at 9:05 PM
Peter
Thanks for the ggplot2 check plot script. I tried it and agree that it is much better than my version, so I’ve updated my R script with your version.
I’ve also added your plot in the post. Thanks
Clint // July 10, 2009 at 4:26 PM |
Hey this is awesome! Thanks!
Joe Mako // July 10, 2009 at 4:17 PM |
Thank you for putting together a great data set.
Here is my first pass at visualizing the data, an interactive dashboard in Tableau:
http://joemako.com/files/Global_Temperature_Data.twbx
You can select or shift-select the measure names, drag the slider and slider ends, or type in the date range.
If you do not have a copy of Tableau, you can download the reader at:
http://www.tableausoftware.com/products/reader-download
or here is a screen capture of it:
http://joemako.com/files/Global_Temperature_Data.png
Kelly // July 10, 2009 at 9:06 PM
Joe
Thanks for taking the time to make your chart. I’ll be adding more climate data via Google docs, so I look forward to your contributions.
Joe Mako // July 17, 2009 at 5:37 PM
Kelly,
I look forward to visualizing any other data you have in store to share. In the mean time, I added the ability to filter the metrics in addition to highlighting, so both filtering and highlighting can be done at the same time.
In other to do this in Tableau, I used Lyza, http://lyzasoft.com, to reshape your provided data set by appending the different metrics as additional rows instead of all values on the same row for each month.
Packed workbook:
http://joemako.com/files/Global_Temperature_Data_v2.twbx
Screen shot:
http://joemako.com/files/Global_Temperature_Data_v2.png
Michael // July 10, 2009 at 1:38 PM |
This is a great idea! Unfortunately, the Google Spreadsheet won’t open without permissions. Is this intentional or did you mean to make it a publicly accessible spreadsheet?
Kelly // July 10, 2009 at 1:52 PM
Michael
Sorry – I wanted it publicly available. I’ve fixed.
Please let me know if you have any problem accessing the Google doc.