# Doing Empirical Orthogonal Function (EOF) analysis in R

I am very new to R and statistics as a whole so this may be a very simple question. I am trying to carry out empirical orthogonal function (EOF) analysis of sea-level pressure (SLP) data to determine the amplitude of the North Atlantic Oscillation over time.

I have a matrix (1000,756), with 1000 years of winter mean SLP (i.e. from December to March) at 756 grid points in the North Atlantic.

How do I go about doing an EOF analysis on this data?

I have spent the last week trying to do a crash course in R but am a little tight for time so I thought I would ask! Thanks in advance for any help.

• Please define "EOF". – Roland Feb 17 '14 at 14:11
• Hi Roland, an Empirical Orthogonal Function is essentially a Principle component analysis. The literature is very unclear and often uses the two terms (EOF/PCA) interchangeably. One definition is "the EOF method finds both time series and spatial patterns". – Edward Armstrong Feb 17 '14 at 16:07

R has routines for doing PCA (prcomp is the preferred method), and also SVD (svd)*, which are the bases for EOF. It also has a screeplot and other tools, but I'm not sure how much code you'll have to put around the SVD itself to do what you want.
There is a spacetime package that has a function EOF. On github there is the sinkr package with an EOF function. At one point, there was a clim.pact package in R, which features an EOF function, but it has been removed from CRAN (perhaps because no longer maintained).
* The prcmp documentation mentions it does an SVD under the hood, so these two options are not totally distinct.
• @EdwardArmstrong: R has a princomp which is mainly for compatability with its predecessor language S. The preferred function to use is prcomp, which uses SVD. It mentions this if you get help on princomp: ?princomp. – Wayne Feb 19 '14 at 14:39