factor_tab | R Documentation |
PCA is performed using add_factors.
factor_tab(
data,
cols,
newcols = NULL,
k = 2,
method = "pca",
labels = TRUE,
clean = TRUE,
...
)
data |
A dataframe. |
cols |
A tidy selection of item columns. If the first column already contains a pca result from \link{add_factors}, the result is used. Other parameters are ignored. If there is no pca result yet, it is calculated by \link{add_factors} first. |
newcols |
Names of the new factor columns as a character vector. Must be the same length as k or NULL. Set to NULL (default) to automatically build a name from the common column prefix, prefixed with "fct_", postfixed with the factor number. |
k |
Number of factors to calculate.
Set to NULL to report eigenvalues for all components up to the number of items
and automatically choose k. Eigenvalues and the decision on k are calculated by
|
method |
The method as character value. Currently, only pca is supported. |
labels |
If TRUE (default) extracts labels from the attributes, see codebook. |
clean |
Prepare data by data_clean. |
... |
Placeholder to allow calling the method with unused parameters from tab_metrics. |
A volker list with with three volker tabs: loadings, variances and diagnostics.
library(volker)
ds <- volker::chatgpt
volker::factor_tab(ds, starts_with("cg_adoption"), k = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.