Learn R Programming

parameters (version 0.1.0)

reshape_loadings: Reshape loadings between wide/long formats

Description

Reshape loadings between wide/long formats.

Usage

reshape_loadings(x, ...)

# S3 method for parameters_efa reshape_loadings(x, threshold = NULL, ...)

# S3 method for data.frame reshape_loadings(x, threshold = NULL, loadings_columns = NULL, ...)

Arguments

x

A dataframe.

...

Arguments passed to or from other methods.

threshold

A value between 0 and 1 indicates which (absolute) values from the loadings should be removed. Can also be "max", in which case it will only display the maximum loading per veriable (the most simple structure).

loadings_columns

Vector indicating the columns corresponding to loadings.

Examples

Run this code
# NOT RUN {
library(parameters)
# }
# NOT RUN {
library(psych)

pca <- model_parameters(psych::fa(attitude, nfactors = 3))
loadings <- reshape_loadings(pca)

loadings
reshape_loadings(loadings)
# }

Run the code above in your browser using DataLab