tests/testthat/test-ksnormal.R

# out1 <- ksnormal(x = mtcars$wt)
# out2 <- suppressWarnings(ks.test(
#   x = mtcars$wt, pnorm, mean = mean(mtcars$wt, na.rm = TRUE),
#   sd = sd(mtcars$wt, na.rm = TRUE))$p.value
# )
# saveRDS(list(out1=out1, out2=out2),file = 'tests/testthat/ksnormal_out.rda')

test_that("ksnormal() with defaults", {
  expected <- readRDS('ksnormal_out.rda')
  expect_equal(ksnormal(x = mtcars$wt), expected[[1]])
  expect_equal(ksnormal(x = mtcars$wt),expected[[2]])
})

Try the wrappedtools package in your browser

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

wrappedtools documentation built on Sept. 24, 2023, 5:06 p.m.