tests/testthat/test_NNS_reg_infinite.R

test_that("native partition complete-case handling keeps infinities", {
  part <- NNS.part(
    x = c(Inf, Inf, NA_real_, NaN),
    y = c(1, 2, 3, 4),
    order = 1,
    obs.req = 0,
    noise.reduction = "median"
  )

  expect_true(any(is.infinite(part$regression.points$x)))
  expect_false(any(is.na(part$regression.points$x)))
})

Try the NNS package in your browser

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

NNS documentation built on July 1, 2026, 1:08 a.m.