tests/testthat/test_qsamp.R

library(alR)

context("General functionality of qsamp")

test_that("numerical result is valid", {
x <- rnorm(100)
expect_equal(qsamp(x, 0.1), quantile(x, 0.1, type=1)[[1]])
expect_equal(qsamp(x, 0.5), quantile(x, 0.5, type=1)[[1]])
expect_equal(qsamp(x, 0.9), quantile(x, 0.9, type=1)[[1]])
})

Try the alR package in your browser

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

alR documentation built on Dec. 7, 2017, 5:03 p.m.