tests/testthat/test-distributions.R

test_that("distributions", {
  skip_if_not_installed("bayestestR")
  skip_if_not_installed("parameters")

  set.seed(123)
  x <- bayestestR::distribution_normal(100)

  expect_equal(kurtosis(x)$Kurtosis, -0.1119534, tolerance = 0.01)
  expect_equal(skewness(x)$Skewness, -5.881466e-17, tolerance = 0.01)
  expect_equal(as.numeric(smoothness(x, "diff")), 1.183699, tolerance = 0.01)
  expect_equal(as.numeric(smoothness(x, "cor")), 0.9979799, tolerance = 0.01)
})

Try the datawizard package in your browser

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

datawizard documentation built on Sept. 15, 2023, 9:06 a.m.