Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Imports:
insight (>= 1.5.4),
parameters (>= 0.29.3),
performance (>= 0.18.2),
datawizard (>= 1.4.00001),
datawizard (>= 1.4.0.9000),
stats,
utils
Suggests:
Expand Down Expand Up @@ -112,3 +112,5 @@ Config/Needs/website:
r-lib/pkgdown,
easystats/easystatstemplate
Config/roxygen2/version: 8.0.0
Remotes:
easystats/datawizard
4 changes: 2 additions & 2 deletions tests/testthat/test-interpret.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
r <- cor(mtcars[, 8:11])
out <- interpret_r(r)

expect_identical(dim(out), dim(r))

Check warning on line 33 in tests/testthat/test-interpret.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=tests/testthat/test-interpret.R,line=33,col=3,[expect_shape_linter] expect_shape(x, dim = d) is better than expect_identical(dim(x), d)
expect_identical(dimnames(out), dimnames(r))

out2 <- interpret_r(as.vector(r))
Expand All @@ -41,7 +41,7 @@
p <- array(runif(3 * 2 * 4, max = 0.1), dim = c(3, 2, 4))
out <- interpret_p(p, rules = "rss")

expect_identical(dim(out), dim(p))

Check warning on line 44 in tests/testthat/test-interpret.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=tests/testthat/test-interpret.R,line=44,col=3,[expect_shape_linter] expect_shape(x, dim = d) is better than expect_identical(dim(x), d)

out2 <- interpret_p(as.vector(p), rules = "rss")
expect_equal(out2, as.vector(out), ignore_attr = TRUE)
Expand Down Expand Up @@ -340,7 +340,7 @@
expect_error(interpret_srmr(0.6, "DUPA"), "must be")

skip_on_cran()
skip_if_not_installed("lavaan")
skip_if_not_installed("lavaan", minimum_version = "0.7.2")
skip_if_not_installed("performance")

structure <- " ind60 =~ x1 + x2 + x3
Expand All @@ -365,7 +365,7 @@
)
expect_equal(
int$Value,
c(0.9666, 0.9124, 0.9749, 1.0001, 1, 0, 0.0273, 0.9529, 0.5199, 1.0001),
c(1, 0.9124, 0.9749, 1.0001, 1, 0, 0.0273, 0.9529, 0.5199, 1.0001),
tolerance = 0.001
)

Expand Down
10 changes: 7 additions & 3 deletions tests/testthat/test-rankES.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
x1 <- x[1:5]
x2 <- x[6:15]

expect_equal(

Check warning on line 30 in tests/testthat/test-rankES.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=tests/testthat/test-rankES.R,line=30,col=3,[expect_identical_linter] Use expect_identical(x, y) by default; resort to expect_equal() only when needed, e.g. when setting ignore_attr= or tolerance=.
rank_biserial(x1, x2),
rank_biserial(as.numeric(x1), as.numeric(x2))
)
Expand All @@ -52,7 +52,7 @@

expect_equal(E[[1]], 0.05934066, tolerance = 0.01)
expect_equal(E$CI_low, 0.01726463, tolerance = 0.01)
expect_equal(E$CI_high, 1)

Check warning on line 55 in tests/testthat/test-rankES.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=tests/testthat/test-rankES.R,line=55,col=3,[expect_identical_linter] Use expect_identical(x, y) by default; resort to expect_equal() only when needed, e.g. when setting ignore_attr= or tolerance=.
})


Expand All @@ -66,7 +66,7 @@

expect_equal(E[[1]], 0.82, tolerance = 0.01)
expect_equal(E$CI_low, 0.78, tolerance = 0.01)
expect_equal(E$CI_high, 1)

Check warning on line 69 in tests/testthat/test-rankES.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=tests/testthat/test-rankES.R,line=69,col=3,[expect_identical_linter] Use expect_identical(x, y) by default; resort to expect_equal() only when needed, e.g. when setting ignore_attr= or tolerance=.
})

test_that("kendalls_w", {
Expand Down Expand Up @@ -272,17 +272,17 @@
)

expect_warning(kendalls_w(m, ci = NULL), "contain ties")
expect_warning(W <- kendalls_w(m, ci = NULL), "unique ranking")

Check warning on line 275 in tests/testthat/test-rankES.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=tests/testthat/test-rankES.R,line=275,col=18,[implicit_assignment_linter] Avoid implicit assignments in function calls. For example, instead of `if (x <- 1L) { ... }`, write `x <- 1L; if (x) { ... }`.
expect_equal(W[[1]], 0.4666667, tolerance = 0.001)
expect_equal(

Check warning on line 277 in tests/testthat/test-rankES.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=tests/testthat/test-rankES.R,line=277,col=3,[expect_identical_linter] Use expect_identical(x, y) by default; resort to expect_equal() only when needed, e.g. when setting ignore_attr= or tolerance=.
kendalls_w(t(m), blocks_on_rows = FALSE, ci = NULL, verbose = FALSE)[[1]],
W[[1]]
)

m[1, 1] <- NA
warns <- capture_warnings(W1 <- kendalls_w(m, ci = NULL))

Check warning on line 283 in tests/testthat/test-rankES.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=tests/testthat/test-rankES.R,line=283,col=29,[implicit_assignment_linter] Avoid implicit assignments in function calls. For example, instead of `if (x <- 1L) { ... }`, write `x <- 1L; if (x) { ... }`.
expect_match(warns[1], "dropped")
expect_equal(W1, kendalls_w(m[, -1], ci = NULL, verbose = FALSE))

Check warning on line 285 in tests/testthat/test-rankES.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=tests/testthat/test-rankES.R,line=285,col=3,[expect_identical_linter] Use expect_identical(x, y) by default; resort to expect_equal() only when needed, e.g. when setting ignore_attr= or tolerance=.

d <- data.frame(
y = OrchardSprays$decrease,
Expand All @@ -291,9 +291,13 @@
)
d_ordered <- d[order(d$b, d$g), ]

w1 <- kendalls_w(tapply(d$y, list(d$b, d$g), identity), ci = NULL)
w2 <- kendalls_w(y ~ g | b, data = d_ordered, ci = NULL)
w3 <- kendalls_w(y ~ g | b, data = d, ci = NULL)
w1 <- kendalls_w(
tapply(d$y, list(d$b, d$g), identity),
ci = NULL,
verbose = FALSE
)
w2 <- kendalls_w(y ~ g | b, data = d_ordered, ci = NULL, verbose = FALSE)
w3 <- kendalls_w(y ~ g | b, data = d, ci = NULL, verbose = FALSE)

expect_identical(w2[[1]], w1[[1]])
expect_identical(w3[[1]], w1[[1]])
Expand Down
Loading