climPCA | R Documentation |
Function to extract the first n principal components explaining a predefined total amount of variance among climatic variables. These components can subsequently be used as synthetic climatic variables to reduce dimensionality in climate-analogue methods.
climPCA(climp, climf, trans = function(x) log(x), cen = TRUE, sc = TRUE, th = 0.8)
climp |
|
climf |
|
trans |
|
cen |
|
sc |
|
th |
|
a list
containing (i) the output from the PCA (call to 'prcomp'), and
(ii) a table with the present/future cell values for the principal components accounting
for the specified percentage of total variance (th).
Jorge Garcia Molinos
dVoCC
, climPlot
comp <- climPCA(JapTC[[c(1,3,5)]], JapTC[[c(2,4,6)]], trans = NA, cen = TRUE, sc = TRUE, th = 0.85)
summary(comp[[1]]) # first two components explain >90% of variance
# Create a data frame with the necessary variables in the required order (see climAna? for details)
clim <- comp[[2]][,c(2,4,3,5,1)]
clim[,c("x","y")] <- xyFromCell(JapTC[[1]], clim$cid)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.