tests/testthat/test_misc.R

context("Misc")

data(biomass)
# scale everything dbl
biomass[] <- lapply(biomass, function(x) if (is.double(x)) scale(x) else x)

fit1 <- lme4::lmer(Biomass ~ Temperature + Precipitation + (1 | Population) + (1 | Year),
  data = biomass
)


set.seed(12)
x <- rnorm(1000)
test_that("CI calc is correct", {
  expect_equal(calc_CI(x, 0.95)$CI_lower, c(-1.954981), tolerance = 0.001)
  expect_equal(calc_CI(x, 0.99)$CI_lower, c(-2.493074), tolerance = 0.001)
})

Try the partR2 package in your browser

Any scripts or data that you put into this service are public.

partR2 documentation built on Jan. 18, 2021, 5:06 p.m.