View source: R/apa_factorLoadings.R
apa_factorLoadings | R Documentation |
Extracts factor loadings from factor analyses (either PCA or EFA) conducthed with the psych package, and returns a APA 7th formatted table with the factor loadings and additional metrics (Communality, Uniqueness, Complexity). If desired this table can directly be exported to a Word file (.docx).
apa_factorLoadings( fa_object, filepath = NA, table_caption = c("Table X", "PCA / EFA Factor Loadings"), overwrite = FALSE, nod = c(3, 2), n.obs = NA, cutoff = 0.3, orderbyloading = TRUE, ... )
fa_object |
Either an |
filepath |
(Optional) Path and filename were the APA ready table should be saved, options include the common filetypes .docx (Word), .pptx (Powerpoint), .html (Webpage). Default is filepath = NA. If NA is given, no file will be saved. |
table_caption |
Takes a character vector. Recommend are the following elements
|
overwrite |
(Optional) Boolean, default is FALSE. When overwrite is
FALSE and the files already exists, a serialized version of the filename
will be created (i.e., appending _001, or _002). Utilizes |
nod |
(Optional) Integer or Integer Vector. Number of Decimals.
In case of -1 a simple convention based on sample size is applied for determination
of number of decimal points. See ?datscience::get_number_of_decimals.
You can also provide an Integer vector, if you want different number of decimals
for the correlations and the summary stats. The first integer determines nod for
factor loadings, the second for additional stats. E.g., c(2,-1) would give 2 decimals
for factor loadings and apply the convention for Complexity, Uniqueness and Communality.
Default is nod = c(3,2). |
n.obs |
(Optional), Only required if you want to apply the convention to number of decimals, and did calculate the factor analysis (PCA, EFA) directly on a correlation or covariance matrix. |
cutoff |
(Optional), Integer, determines the minimum threshold, values below are omitted. Default is cutoff = 0.3. |
orderbyloading |
(Optional), Boolean, default is |
... |
(Optional), Additional arguments that can be passed to |
A flextable
object with APA ready correlation table. If a filepath is provided
it also creates the respective file (e.g., a word .docx file)
Bjoern Buedenbender
get_number_of_decimals
, format_flextable
,
serialNext
datscience::apa_factorLoadings(psych::fa(mtcars, nfactors = 2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.