Skip to content

Commit

Permalink
fix CRAN check issue
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Sep 25, 2023
1 parent 285ff6d commit 7332c7f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/testthat/test-find_weights.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ skip_if_not_installed("lme4")

test_that("find_weights", {
data(mtcars)
mtcars$weight <- rnorm(nrow(mtcars), 1, 0.3)
set.seed(123)
mtcars$weight <- abs(rnorm(nrow(mtcars), 1, 0.3))
m <- lm(mpg ~ wt + cyl + vs, data = mtcars, weights = weight)
expect_identical(find_weights(m), "weight")
})

test_that("find_weights", {
data(iris)
iris$wgt <- rnorm(nrow(iris), 1, 0.3)
set.seed(123)
iris$wgt <- abs(rnorm(nrow(iris), 1, 0.3))
m <- lme4::lmer(Sepal.Width ~ Sepal.Length + (1 | Species), data = iris, weights = wgt)
expect_identical(find_weights(m), "wgt")
})
Expand Down

0 comments on commit 7332c7f

Please sign in to comment.