pca_decision | R Documentation |
pca_decision
plots the explained variances against the number of the principal component. In addition, it returns all the information about the PCA performance.
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.
as_synoptReg
# Load data (mslp or precp_grid)
data(msl)
data(z500)
# Joining both variables
atmos_data <- dplyr::bind_rows(msl,z500)
# Deciding on the number of PC to retain
info <- pca_decision(atmos_data, norm = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.