View source: R/reshape_loadings.R
reshape_loadings | R Documentation |
Reshape loadings between wide/long formats.
reshape_loadings(x, ...)
## S3 method for class 'parameters_efa'
reshape_loadings(x, threshold = NULL, ...)
## S3 method for class 'data.frame'
reshape_loadings(x, threshold = NULL, loadings_columns = NULL, ...)
x |
A data frame or a statistical model. |
... |
Arguments passed to or from other methods. |
threshold |
A value between 0 and 1 indicates which (absolute) values
from the loadings should be removed. An integer higher than 1 indicates the
n strongest loadings to retain. Can also be |
loadings_columns |
Vector indicating the columns corresponding to loadings. |
if (require("psych")) {
pca <- model_parameters(psych::fa(attitude, nfactors = 3))
loadings <- reshape_loadings(pca)
loadings
reshape_loadings(loadings)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.