tests/testthat/test-psych.R
raw| 1 | skip_on_cran() |
| 2 | |
| 3 | skip_if_not_installed("modeltests") |
| 4 | library(modeltests) |
| 5 | |
| 6 | skip_if_not_installed("psych") |
| 7 | |
| 8 | test_that("tidy.kappa works", { |
| 9 | check_arguments(tidy.kappa) |
| 10 | |
| 11 | # breaks on R 3.4 is df is a tibble |
| 12 | df <- cbind( |
| 13 | rater1 = 1:9, |
| 14 | rater2 = c(1, 3, 1, 6, 1, 5, 5, 6, 7) |
| 15 | ) |
| 16 | |
| 17 | fit <- psych::cohen.kappa(df) |
| 18 | |
| 19 | td <- tidy(fit) |
| 20 | check_tidy_output(td) |
| 21 | check_dims(td, 2, 4) |
| 22 | }) |