tests/testthat/test-npcdist.R

test_that("npcdist basic functionality works", {
  data("faithful")
  bw <- npcdistbw(xdat=faithful$eruptions, ydat=faithful$waiting, 
                  bws=c(0.5, 5), bandwidth.compute=FALSE)
  
  fit <- npcdist(bws=bw)
  
  expect_s3_class(fit, "condistribution")
  expect_type(predict(fit), "double")
  expect_equal(length(predict(fit)), nrow(faithful))
  
  expect_output(summary(fit))
})

Try the np package in your browser

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

np documentation built on May 3, 2026, 1:07 a.m.