Skip to content

Commit

Permalink
add also as attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
DominiqueMakowski committed Nov 30, 2023
1 parent 1c89a11 commit c815a15
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/n_factors.R
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down

0 comments on commit c815a15

Please sign in to comment.