Running ‘testthat.R’ [13s/16s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > # This file is part of the standard setup for testthat.
  > # It is recommended that you do not modify it.
  > #
  > # Where should you do additional test configuration?
  > # Learn more about the roles of various files in:
  > # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
  > # * https://testthat.r-lib.org/articles/special-files.html
  > 
  > library(testthat)
  > library(smoothemplik)
  Smoothed Empirical Likelihood version 0.0.17 (2025-10-28).
  Package under active development; core functions subject to change.
  > 
  > test_check("smoothemplik")
  Saving _problems/test-DCV-11.R
  Saving _problems/test-bw.CV-12.R
  Saving _problems/test-bw.CV-24.R
  Timing stopped at: 0.046 0 0.046
  Saving _problems/test-bw.CV-42.R
  Saving _problems/test-kernelDiscreteDensitySmooth-8.R
  Saving _problems/test-kernelMixed-12.R
  Saving _problems/test-kernelSmooth-2.R
  Saving _problems/test-kernelSmooth-40.R
  Saving _problems/test-prepareKernel-19.R
  [ FAIL 9 | WARN 0 | SKIP 1 | PASS 231 ]
  
  ══ Skipped tests (1) ═══════════════════════════════════════════════════════════
  • empty test (1):
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-DCV.R:11:3'): DCV works for density cross-validation ───────────
  Error in ``[.data.table`(x, , `:=`(`(id)` = .GRP, `(count)` = .N), by = names(x))`: attempt access index 1/1 in VECTOR_ELT
  Backtrace:
       ▆
    1. ├─testthat::expect_true(...) at test-DCV.R:11:3
    2. │ └─testthat::quasi_label(enquo(object), label)
    3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
    4. ├─base::suppressMessages(DCV(x, bw = bw.grid, weights = w))
    5. │ └─base::withCallingHandlers(...)
    6. └─smoothemplik::DCV(x, bw = bw.grid, weights = w)
    7.   └─smoothemplik::prepareKernel(...)
    8.     └─smoothemplik:::.deduplicate(xy)
    9.       ├─x[, `:=`(`(id)` = .GRP, `(count)` = .N), by = names(x)]
   10.       └─data.table:::`[.data.table`(...)
  ── Error ('test-bw.CV.R:12:3'): LSCV works for least-squares cross-validation ──
  Error in ``[.data.table`(x, , `:=`(`(id)` = .GRP, `(count)` = .N), by = names(x))`: attempt access index 2/2 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─smoothemplik::LSCV(x, y = y, bw = bw.grid, weights = w) at test-bw.CV.R:12:3
   2.   └─smoothemplik::prepareKernel(...)
   3.     └─smoothemplik:::.deduplicate(xy)
   4.       ├─x[, `:=`(`(id)` = .GRP, `(count)` = .N), by = names(x)]
   5.       └─data.table:::`[.data.table`(...)
  ── Error ('test-bw.CV.R:23:3'): LSCV handles multivariate inputs with unique and distinct bws, finding an improvement ──
  Error in ``[.data.table`(x, , `:=`(`(id)` = .GRP, `(count)` = .N), by = names(x))`: attempt access index 4/4 in VECTOR_ELT
  Backtrace:
       ▆
    1. ├─base::system.time(...) at test-bw.CV.R:23:3
    2. ├─testthat::expect_true(...)
    3. │ └─testthat::quasi_label(enquo(object), label)
    4. │   └─rlang::eval_bare(expr, quo_get_env(quo))
    5. ├─base::suppressWarnings(...)
    6. │ └─base::withCallingHandlers(...)
    7. └─smoothemplik::bw.CV(...)
    8.   └─smoothemplik::prepareKernel(...)
    9.     └─smoothemplik:::.deduplicate(xy)
   10.       ├─x[, `:=`(`(id)` = .GRP, `(count)` = .N), by = names(x)]
   11.       └─data.table:::`[.data.table`(...)
  ── Error ('test-bw.CV.R:42:3'): bw.CV de-duplicates correctly and minimises the CV criterion ──
  Error in ``[.data.table`(x, , `:=`(`(id)` = .GRP, `(count)` = .N), by = names(x))`: attempt access index 2/2 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─smoothemplik::LSCV(x, y, bw.grid, weights = w) at test-bw.CV.R:42:3
   2.   └─smoothemplik::prepareKernel(...)
   3.     └─smoothemplik:::.deduplicate(xy)
   4.       ├─x[, `:=`(`(id)` = .GRP, `(count)` = .N), by = names(x)]
   5.       └─data.table:::`[.data.table`(...)
  ── Error ('test-kernelDiscreteDensitySmooth.R:8:3'): kernelDiscreteDensitySmooth works ──
  Error in ``[.data.table`(x, , `:=`(`(id)` = .GRP, `(count)` = .N), by = names(x))`: attempt access index 2/2 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─smoothemplik::prepareKernel(x = x2, y = y, bw = 1) at test-kernelDiscreteDensitySmooth.R:8:3
   2.   └─smoothemplik:::.deduplicate(xy)
   3.     ├─x[, `:=`(`(id)` = .GRP, `(count)` = .N), by = names(x)]
   4.     └─data.table:::`[.data.table`(...)
  ── Error ('test-kernelMixed.R:11:3'): kernelMixedSmooth and kernelMixedDensity de-duplicate correctly ──
  Error in ``[.data.table`(x, , `:=`(`(id)` = .GRP, `(count)` = .N), by = names(x))`: attempt access index 2/2 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─smoothemplik::kernelMixedDensity(...) at test-kernelMixed.R:11:3
   2.   └─smoothemplik:::.kernelMixed(...)
   3.     └─smoothemplik::prepareKernel(...)
   4.       └─smoothemplik:::.deduplicate(xy)
   5.         ├─x[, `:=`(`(id)` = .GRP, `(count)` = .N), by = names(x)]
   6.         └─data.table:::`[.data.table`(...)
  ── Error ('test-kernelSmooth.R:2:3'): kernelSmooth correctly handles bad inputs ──
  Error in ``[.data.table`(x, , `:=`(`(id)` = .GRP, `(count)` = .N), by = names(x))`: attempt access index 2/2 in VECTOR_ELT
  Backtrace:
       ▆
    1. ├─testthat::expect_error(kernelSmooth(c(1:9, NA), 1:10), "finite numeric values only") at test-kernelSmooth.R:2:3
    2. │ └─testthat:::expect_condition_matching_(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. └─smoothemplik::kernelSmooth(c(1:9, NA), 1:10)
    8.   └─smoothemplik::prepareKernel(...)
    9.     └─smoothemplik:::.deduplicate(xy)
   10.       ├─x[, `:=`(`(id)` = .GRP, `(count)` = .N), by = names(x)]
   11.       └─data.table:::`[.data.table`(...)
  ── Error ('test-kernelSmooth.R:40:3'): de-duplication works in kernelSmooth ────
  Error in ``[.data.table`(x, , `:=`(`(id)` = .GRP, `(count)` = .N), by = names(x))`: attempt access index 2/2 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─smoothemplik::kernelSmooth(...) at test-kernelSmooth.R:40:3
   2.   └─smoothemplik::prepareKernel(...)
   3.     └─smoothemplik:::.deduplicate(xy)
   4.       ├─x[, `:=`(`(id)` = .GRP, `(count)` = .N), by = names(x)]
   5.       └─data.table:::`[.data.table`(...)
  ── Error ('test-prepareKernel.R:19:3'): de-duplication in kernel preparation works correctly ──
  Error in ``[.data.table`(x, , `:=`(`(id)` = .GRP, `(count)` = .N), by = names(x))`: attempt access index 11/11 in VECTOR_ELT
  Backtrace:
      ▆
   1. └─smoothemplik::prepareKernel(x, y, xout, w, bw = 0.5) at test-prepareKernel.R:19:3
   2.   └─smoothemplik:::.deduplicate(xy)
   3.     ├─x[, `:=`(`(id)` = .GRP, `(count)` = .N), by = names(x)]
   4.     └─data.table:::`[.data.table`(...)
  
  [ FAIL 9 | WARN 0 | SKIP 1 | PASS 231 ]
  Error:
  ! Test failures.
  Execution halted