plotEOF: Plot EOFs

View source: R/plotEOF.R

plotEOFR Documentation

Plot EOFs

Description

Plots an arbitrary number of EOFs. Useful to have a quick overview of the main spatial modes of a (possibly multimember) grid.

Usage

plotEOF(prinCompObj, var = NULL, member = 1, n.eofs = NULL, ...)

Arguments

prinCompObj

A PCA object as returned by prinComp

var

Character string indicating the variable whose EOFs are to be displayed. If the PCA analysis has been applied to 1 single grid, this argument can be omitted.

member

An integer indicating the position of the member whose EOFs are to be displayed. Default 1, corresponding to the first member. Ignored for non multimember grids.

n.eofs

Number of EOFs to be displayed. Default to NULL, indicating that all computed EOFS will be represented

...

Further arguments passed to spatialPlot.

Details

This function was formerly in transformeR. It is planned to de deprecated, and superseded by spatialPlot

Value

A plot with as many panels as EOFs requested, in the original units of the variable

Author(s)

J. Bedia

Examples


require(climate4R.datasets) 
require(transformeR)
# Winter temperature at 850 mb isobaric surface pressure level is loaded (period 1981--2010):
data("NCEP_Iberia_hus850")
# PCA analysis, retaining the PCs that explain 90\% of the total variance:
pca <- prinComp(NCEP_Iberia_hus850, v.exp = .90)
# Plot of all EOFs
plotEOF(pca, backdrop.theme = "coastline")
# Plot the first 4 EOFs:
plotEOF(pca, n.eofs = 4, backdrop.theme = "coastline")
# Plot just the second EOF (passing further arguments to spatialPlot):
plotEOF(pca, zcol = 2, backdrop.theme = "coastline", main = "2nd EOF ('zcol = 2')")
# Example with PCA analysis of a multigrid (multiple variables)
data("NCEP_Iberia_ta850", "NCEP_Iberia_psl")
multigrid <- makeMultiGrid(NCEP_Iberia_hus850, NCEP_Iberia_ta850, NCEP_Iberia_psl)
# PCA analysis, retaining the first 9 PCs of each variable:
pca2 <- prinComp(multigrid, n.eofs = 9)
names(pca2)
# EOFs for temperature 850mb
plotEOF(pca2, "ta@850", backdrop.theme = "coastline")


SantanderMetGroup/visualizeR documentation built on Oct. 28, 2023, 6:11 a.m.