pca_decision: PCA decision

Description Usage Arguments Value Note See Also Examples

View source: R/pca_decision.R

Description

pca_decision plots the explained variances against the number of the principal component. In addition, it returns all the information about the PCA performance.

Usage

1
pca_decision(x, ncomp = 30, norm = T, matrix_mode = "S-mode")

Arguments

x

data.frame. A data.frame with the following variables: lon, lat, time, value, anom_value. See tidy_nc.

ncomp

integer. Number of principal components to show/retain

norm

logical. Default TRUE. norm = TRUE is recommended for classify two ore more variables.

matrix_mode

character. The mode of matrix to use. Choose between S-mode and T-mode

Value

a list with:

Note

To perform the PCA the x must contain more rows than columns. In addition, x cannot contain NA values.

See Also

tidy_nc

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Load data (mslp or precp_grid)
data(mslp)
data(z500)
# Tidying our atmospheric variables (500 hPa geopotential height
# and mean sea level pressure) together.

# Time subset between two dates
atm_data1 <- tidy_nc(x = list(mslp,z500))

# Deciding on the number of PC to retain
info <- pca_decision(atm_data1)

synoptReg documentation built on April 22, 2021, 1:06 a.m.