tests/testthat/test_kdensity_helpers.R

context("kdensity helper (default arguments)")
expect_equal(kdensity(precip, support = c(-Inf, Inf))$kernel_str, "gaussian")
expect_equal(kdensity(precip, support = c(0, Inf))$kernel_str, "gamma")
expect_message(kdensity(precip, support = c(7, 999)))
expect_equal(kdensity(precip, support = c(7, 999))$kernel_str, "gamma")
expect_equal(kdensity(precip, support = c(-5, 999))$kernel_str, "gaussian")
set.seed(313)
expect_equal(kdensity(rbeta(10, 10, 10), support = c(0.1, 0.9))$kernel_str, "gcopula")

Try the kdensity package in your browser

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

kdensity documentation built on Oct. 23, 2020, 8:32 p.m.