AMO graph
R has very versatile graphical capabilities; it can also fit a variety of smoothers to the data.
As an example of this, some may have seen this graph use HTML published in this recent series of [www.lloyds.com|lloyds papers] embed 360 graph.
Here is the R code which produces the graph. The AMO data can be found from here, tvhe number of major hurricanes data was taken from this paper by ?, Gray etc (you'll need a Nature subscription).
If you want to trial run the code you will need to:
* Download this database.
* Set up an ODBC link; naming the database "ClimateChangeData", here is how to do this (it really isnt hard).
* Make sure you have downloaded the R package RODBC; this is a really useful package which enables you to run SQL from R to query and write to an external database. Here is how to download packages.
* Run the R code through R
Note if you want to supress the individual data points (grey) then see the "typeVal" variable in the code and follow the comment.
Notes on the Graph:
* The two orange (smoothers) are gaussian Kernel Smoothers with a 10 year bandwidth
* The blue long term trend line for the AMO data is a 120 year bandwidth guassian Kernel smoother
* The blue long term trend line for the hurricane data is a simple linear regression through the data.
The first two bullets would have been time consuming to do in Excel; as usual the power of the R community wins!
Comments (0)
You don't have permission to comment on this page.