In this post, I show an R script that downloads the University of Colorado, Boulder’s 1993-2009 global mean sea level (msl) change (link) data, converts the ASCII file into a usable R data frame, calculates moving average and msl change trend rate and develops a trend chart that shows msl change and trend rates and writes a csv file that I upload to Google Docs.
Mean Sea Level Trends
I have developed a number of climate trend charts in previous posts, including: here, here, here and here. These posts have dealt with atmospheric temperature anomalies, sea surface temperature,and CO2 emissions and atmospheric concentrations. In this post, I present the 1993 – 2009 mean sea level change data record maintained by the University of Colorado, Boulder (UCB).
UCB’s data series is available at this link. Here’s a screen shot of the first few lines of the ASCII file.
A few things to notice about this data file:
- simple, clean file with 1 row per period
- date is presented as decimal year, 1993.0409 – equivalent to 1/17/1993
- time series interval is approximately 10 days
R Script and SST Anomaly Trend Chart
My R script reads the source file msl data, calculates the 60 day moving average and linear trend rate and prepares the chart below which shows the msl, the moving average and linear trend line.
My chart format is a close reproduction on UCB’s original version.
Review of UCB’s MSL Change Trends
The UCB msl trend rate shows steadily increasing trend in the 1993-2009 period, averaging 3.1 mm per year. This rate is equivalent to 310 mm or 1.02 feet in a century.
R Script and UCB’s Data On-line
I have posted my R script and UCB files as Google documents. You can access them at these links:
- R script
- UCB msl





Pingback: RClimate Script: Global Mean Sea Level Trend by Month « Climate Charts & Graphs
Pingback: Understanding the Science of CO2’s Role in Climate Change: 1 – Introduction « Climate Charts & Graphs
For the moving average, I would suggest that the loess or lowess functions would produce more representative results. You can play around the parameters to obtain the level of detail that you like.
When looking for detectable shifts from a mean, as with this data, you would also do well to produce a process behavior chart. I think that the Exponentially Weighted Moving Average (EWMA) chart would be ideal for this data. However, I have yet to find a good EWMA chart in R (I use Minitab to produce these). Producing one might be a good challenge, and advance the R code base.