Skip to content

Commit

Permalink
[Fix] Fixes edgecase for predict.parameters_efa (#980)
Browse files Browse the repository at this point in the history
* fix edgecase in predict for fa objects

* fix?
  • Loading branch information
DominiqueMakowski authored Jun 17, 2024
1 parent 5adbe97 commit 266c947
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/utils_pca_efa.R
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ predict.parameters_efa <- function(object,
out <- as.matrix(newdata) %*% as.matrix(attri$model$loadings)
out <- stats::setNames(as.data.frame(out), paste0("Component", seq_len(ncol(out))))
} else if (inherits(attri$model, c("psych", "fa", "principal"))) {
out <- as.data.frame(stats::predict(attri$model, data = newdata, ...))
out <- as.data.frame(stats::predict(attri$model, data = newdata[rownames(attri$model$weights)], ...))
} else {
out <- as.data.frame(stats::predict(attri$model, newdata = newdata, ...))
}
Expand Down

0 comments on commit 266c947

Please sign in to comment.