File: test-efa.R

package info (click to toggle)
r-cran-parameters 0.24.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,852 kB
  • sloc: sh: 16; makefile: 2
file content (16 lines) | stat: -rw-r--r-- 486 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
skip_on_cran()

test_that("predict.parameters_efa works with verbose", {
  skip_if_not_installed("psych")
  d <- psych::bfi[, 1:25]
  d <- na.omit(d)
  efa <- psych::fa(d, nfactors = 5)
  out <- model_parameters(efa, sort = TRUE, threshold = "max")

  predictions <- predict(
    out,
    names = c("Neuroticism", "Conscientiousness", "Extraversion", "Agreeableness", "Opennness"),
    verbose = FALSE
  )
  expect_identical(dim(predictions), as.integer(c(2436, 5)))
})