Skip to content

Commit 7a961ff

Browse files
committed
default oblimin
1 parent 6c0fa01 commit 7a961ff

File tree

5 files changed

+12
-5
lines changed

5 files changed

+12
-5
lines changed

NEWS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44

55
* The `standardize` argument in `factor_analysis()` now defaults to `FALSE`.
66

7+
* The `rotation` argument in `factor_analysis()` now defaults to `"oblimin"`,
8+
because the former default of `"none"` rarely makes sense in the context of
9+
factor analysis. If you want to use no rotation, please set `rotation =
10+
"none"`.
11+
712
* The `cor` argument in `n_factors()` was renamed into `correlation_matrix`. In
813
`factor_analysis()`, the `cor` argument was completely removed to avoid naming
914
collision with the `cor` argument of `psych::fa()`, which now users can pass

R/factor_analysis.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ factor_analysis <- function(x, ...) {
99
#' @export
1010
factor_analysis.data.frame <- function(x,
1111
n = "auto",
12-
rotation = "none",
12+
rotation = "oblimin",
1313
sort = FALSE,
1414
threshold = NULL,
1515
standardize = FALSE,

R/principal_components.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
#' @param rotation If not `"none"`, the PCA / FA will be computed using the
2020
#' **psych** package. Possible options include `"varimax"`, `"quartimax"`,
2121
#' `"promax"`, `"oblimin"`, `"simplimax"`, or `"cluster"` (and more). See
22-
#' [`psych::fa()`] for details.
22+
#' [`psych::fa()`] for details. The default is `"none"` for PCA, and
23+
#' `"oblimin"` for FA.
2324
#' @param sparse Whether to compute sparse PCA (SPCA, using [`sparsepca::spca()`]).
2425
#' SPCA attempts to find sparse loadings (with few nonzero values), which improves
2526
#' interpretability and avoids overfitting. Can be `TRUE` or `"robust"` (see

man/principal_components.Rd

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/test-pca.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ test_that("predict model_parameters fa", {
103103
predict(mp, names = c("A", "B", "C", "D", "E"), keep_na = FALSE),
104104
c("A", "B", "C", "D", "E")
105105
)
106-
model <- factor_analysis(d, n = 5)
106+
model <- factor_analysis(d, n = 5, rotation = "none")
107107
expect_identical(nrow(predict(model, keep_na = FALSE)), 2436L)
108108
})
109109

0 commit comments

Comments
 (0)