tests/testthat/_problems/test_HistogramBinOrder-10.R

# Extracted from test_HistogramBinOrder.R:10

# setup ------------------------------------------------------------------------
library(testthat)
test_env <- simulate_test_env(package = "DistributionalDDA", path = "..")
attach(test_env, warn.conflicts = FALSE)

# test -------------------------------------------------------------------------
w <- c(4, 3, 2, 1)
f <- .DensityFromHist(w, breaks = 0:4)
expect_equal(f(c(0.5, 1.5, 2.5, 3.5)), c(4, 3, 2, 1))

Try the DistributionalDDA package in your browser

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

DistributionalDDA documentation built on Oct. 20, 2026, 5:06 p.m.