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"]