tests/testthat/test-sample_qtls.R

test_that("Sampled quantiles are returned",{
  set.seed(1234)
  sampd <- sample_qtls(10,c(0.1,0.2,0.3),qtls=c(0.05,0.1,0.95))
  expect_equal(
    sampd[1],
    expected = 0.052807659
  )
  expect_equal(
    length(sampd),
    expected = 10
  )
  expect_equal(
    sampd[10],
    expected = 0.103586294
  )

  testthat::expect_error(sample_qtls(10,c(0.1,0.2),qtls=c(0.05,0.1,0.95)))

})

Try the stochLAB package in your browser

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

stochLAB documentation built on Dec. 28, 2022, 1:19 a.m.