EOF2clim: PCA object EOFs to climatology grid

View source: R/EOF2clim.R

EOF2climR Documentation

PCA object EOFs to climatology grid

Description

Converts a prinComp output to a climatology of EOFs.

Usage

EOF2clim(prinCompObj, ind.var, member = 1L, n.eofs = 1L, rescale = TRUE)

Arguments

prinCompObj

PCA object

ind.var

index position of the target variable

member

Integer. index position of the member whose EOFs are to be displayed. Default to 1 (ignored if no members available)

n.eofs

Integer. Number of EOFs to be displayed (from 1 to n.eofs). Default to one -first- EOF.

rescale

Logical flag. Default to TRUE, which rescales the EOF to the original input variable units.

Value

A climatological grid. Note that EOFs are treated as members

Author(s)

J Bedia

Examples

## Not run: 
require(climate4R.datasets)
data("NCEP_Iberia_hus850", "NCEP_Iberia_psl", "NCEP_Iberia_ta850")
multigrid <- makeMultiGrid(NCEP_Iberia_hus850, NCEP_Iberia_psl, NCEP_Iberia_ta850)
# In this example, we retain the PCs explaining the 99\
pca <- prinComp(multigrid, v.exp = c(.95,0.90,.90), keep.orig = FALSE)
require(visualizeR)
# Original EOF
EOF2clim(pca, ind.var = "psl") %>% spatialPlot(backdrop.theme = "coastline")
# Rescaled EOF
EOF2clim(pca, ind.var = "psl", rescale = FALSE) %>% spatialPlot(backdrop.theme = "coastline")

## End(Not run)

SantanderMetGroup/transformeR documentation built on Oct. 28, 2023, 5:26 a.m.