eof: Performs an EOF decomposition of the data

Description Usage Arguments Value Examples

View source: R/eof.R

Description

Uses the stats::prcomp function to implement EOF decompositions of data

Usage

1
eof(X, center = F, scale = F)

Arguments

X

[variable x observation] matrix of data for which to compute EOFs

center

TRUE/FALSE to center columns of X in call to prcomp

scale

TRUE/FALSE to scale columns of X in call to prcomp

Value

A list containing EOF patterns as columns, and their scores

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
data("coprecip")
attach(coprecip)

# compute ocean surface temperature eofs
eofs = eof(Z)

# view first EOF, which corresponds to the El-Nino pattern
coords.r.mod = coords.r
coords.r.mod[,1][coords.r.mod[,1]>0] =
  coords.r.mod[,1][coords.r.mod[,1]>0] - 360
fields::quilt.plot(coords.r.mod, eofs$patterns[,1])

# alternatively, the plot.stData function can directly compute and plot EOFs
plot(coprecip, type='eof', pattern=1)

jmhewitt/telefit documentation built on Feb. 9, 2020, 7:15 p.m.