I just made the sealevel R package, which we used for the sea-level rise articles, available. It provides some functions to quickly download, read and analyse the global tide gauges and satellite data.
All suggestions, patches, comments are welcome. This package is part of OpenEarth but available through r-forge for the convenience of R users.
- Trends in Sea-Level Trend Analysis
- The Effect of the 18.6-Year Lunar Nodal Cycle on Regional Sea-Level Rise Estimates
Example
The code below generates the plot of the Dutch tide gauges.
# install.packages("sealevel", repos="http://r-forge.r-project.org") library(sealevel) library(ggplot2) library(plyr) # Load the Dutch sealevel data data(dutch) # Let's plot them all # The stations are a list of objects, but we can make a data frame like this station2df <- function(x){ df <- x$data df$name <- x$name # set -999 to missing df$waterlevel[df$waterlevel==-999.9] <- NA return(df) } # Let's do bit of map reducing, list -> station2df -> data.frame dutchdf <- ldply(dutch, station2df) # Now make a factor instead from the strings dutchdf$name <- as.factor(dutchdf$name) # so we can use it to shift the waterlevels a bit dutchdf$waterlevel <- dutchdf$waterlevel - as.numeric(dutchdf$name)*10 # Use the gramar of graphics approach p <- ggplot(dutchdf, aes(year, waterlevel, color=name)) # Fit a nodal cycle (long term tide), See Baart et al 2012 in JCR. p + geom_point() + geom_smooth(method='lm', formula=y~x+I(cos(2*pi*x/18.613))+I(sin(2*pi*x/18.613)))
Notice that after the last 6 years of (average) sea-level decline we are about to see a rising sea level at the Dutch coast again for the next 12 years.