From c815a159d6d1b8f9cb9676edaa87c57e2d9cbe54 Mon Sep 17 00:00:00 2001 From: Dominique Makowski Date: Thu, 30 Nov 2023 16:17:05 +0000 Subject: [PATCH] add also as attribute --- R/n_factors.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/R/n_factors.R b/R/n_factors.R index eaa210e39..6d6644258 100644 --- a/R/n_factors.R +++ b/R/n_factors.R @@ -345,9 +345,10 @@ n_factors <- function(x, varex <- attributes(fa)$summary # Extract number of factors from EFA output (usually MR1, ML1, etc.) varex$n_Factors <- as.numeric(gsub("[^\\d]+", "", varex$Component, perl = TRUE)) + # Merge (and like that filter out empty methods) by_factors <- merge(by_factors, varex[, c("n_Factors", "Variance_Cumulative")], by = "n_Factors") - + attr(out, "Variance_Explained") <- varex # We add all the variance explained (for plotting) attr(out, "summary") <- by_factors attr(out, "n") <- min(as.numeric(as.character( by_factors[by_factors$n_Methods == max(by_factors$n_Methods), "n_Factors"]