Description Usage Arguments Value Note See Also Examples
pca_decision
plots the explained variances against the number of the principal component. In addition, it returns all the information about the PCA performance.
1 | pca_decision(x, ncomp = 30, norm = T, matrix_mode = "S-mode")
|
x |
data.frame. A data.frame with the following variables: |
ncomp |
integer. Number of principal components to show/retain |
norm |
logical. Default |
matrix_mode |
character. The mode of matrix to use. Choose between S-mode and T-mode |
a list with:
A list with class princomp
containing all the results of the PCA
A data frame containing the main results of the ncomp
selected (standard deviation, proportion of variance and cumulative variance).
A ggplot2
object to visualize the scree test
To perform the PCA the x
must contain more rows than columns. In addition, x
cannot contain NA
values.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.