Running ‘testthat.R’ [3s/4s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(BTYDplus)
  > 
  > test_check("BTYDplus")
  ── 1. Error: BG/CNBD-k (@test-bg-cnbd-k.R#10)  ─────────────────────────────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: bgcnbd.GenerateData(n, round(runif(n, 36, 96)/12) * 12, 36, params, date.zero) at testthat/test-bg-cnbd-k.R:10
  2: xbgcnbd.GenerateData(n, T.cal, T.star, params, date.zero, dropout_at_zero = FALSE)
  3: elog2cbs(elog, T.cal = date.cal)
  4: elog_dt[, `:=`(first, min(date)), by = "cust"]
  5: `[.data.table`(elog_dt, , `:=`(first, min(date)), by = "cust")
  
  ── 2. Error: elog2cbs (@test-elog2cbs.R#8)  ────────────────────────────────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: elog_dt[, `:=`(first, min(date)), by = "cust"] at testthat/test-elog2cbs.R:8
  2: `[.data.table`(elog_dt, , `:=`(first, min(date)), by = "cust") at testthat/test-elog2cbs.R:8
  
  ── 3. Error: elog2cum (@test-helpers.R#27)  ────────────────────────────────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: elog2cum(cdnowElog) at testthat/test-helpers.R:27
  2: elog[, `:=`(t0, min(t)), by = "cust"]
  3: `[.data.table`(elog, , `:=`(t0, min(t)), by = "cust")
  
  ── 4. Error: plotTimingPatterns (@test-helpers.R#49)  ──────────────────────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: expect_silent(plotTimingPatterns(groceryElog)) at testthat/test-helpers.R:49
  2: quasi_capture(enquo(object), evaluate_promise)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  5: force(code)
  6: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  7: withVisible(code)
  8: eval_bare(get_expr(quo), get_env(quo))
  9: plotTimingPatterns(groceryElog)
  10: elog_dt[, `:=`(first, min(t)), by = "cust"]
  11: `[.data.table`(elog_dt, , `:=`(first, min(t)), by = "cust")
  
  ── 5. Error: MBG/CNBD-k (@test-mbg-cnbd-k.R#9)  ────────────────────────────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: mbgcnbd.GenerateData(n, round(runif(n, 36, 96)/12) * 12, 36, params, "2010-01-01") at testthat/test-mbg-cnbd-k.R:9
  2: xbgcnbd.GenerateData(n, T.cal, T.star, params, date.zero, dropout_at_zero = TRUE)
  3: elog2cbs(elog, T.cal = date.cal)
  4: elog_dt[, `:=`(first, min(date)), by = "cust"]
  5: `[.data.table`(elog_dt, , `:=`(first, min(date)), by = "cust")
  
  ── 6. Error: MCMC Helpers (@test-mcmc.R#12)  ───────────────────────────────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: pnbd.GenerateData(n = 100, 28, 28, pnbd.params) at testthat/test-mcmc.R:12
  2: pggg.GenerateData(n, T.cal, T.star, params, date.zero)
  3: elog2cbs(elog, T.cal = date.cal)
  4: elog_dt[, `:=`(first, min(date)), by = "cust"]
  5: `[.data.table`(elog_dt, , `:=`(first, min(date)), by = "cust")
  
  ── 7. Error: NBD (@test-nbd.R#8)  ──────────────────────────────────────────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: expect_silent(nbd.GenerateData(100, 32, c(16, 32), params, "2010-01-01")) at testthat/test-nbd.R:8
  2: quasi_capture(enquo(object), evaluate_promise)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  5: force(code)
  6: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  7: withVisible(code)
  8: eval_bare(get_expr(quo), get_env(quo))
  9: nbd.GenerateData(100, 32, c(16, 32), params, "2010-01-01")
  10: elog2cbs(elog, T.cal = date.cal)
  11: elog_dt[, `:=`(first, min(date)), by = "cust"]
  12: `[.data.table`(elog_dt, , `:=`(first, min(date)), by = "cust")
  
  ── 8. Error: Pareto/GGG MCMC (@test-pareto-ggg-mcmc.R#8)  ──────────────────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: expect_silent(pggg.GenerateData(n, 52, c(26, 52), params)) at testthat/test-pareto-ggg-mcmc.R:8
  2: quasi_capture(enquo(object), evaluate_promise)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  5: force(code)
  6: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  7: withVisible(code)
  8: eval_bare(get_expr(quo), get_env(quo))
  9: pggg.GenerateData(n, 52, c(26, 52), params)
  10: elog2cbs(elog, T.cal = date.cal)
  11: elog_dt[, `:=`(first, min(date)), by = "cust"]
  12: `[.data.table`(elog_dt, , `:=`(first, min(date)), by = "cust")
  
  ── 9. Error: Pareto/NBD MCMC (@test-pareto-nbd-mcmc.R#11)  ─────────────────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: pggg.GenerateData(5, T.cal, T.star, params, date.zero) at testthat/test-pareto-nbd-mcmc.R:11
  2: elog2cbs(elog, T.cal = date.cal)
  3: elog_dt[, `:=`(first, min(date)), by = "cust"]
  4: `[.data.table`(elog_dt, , `:=`(first, min(date)), by = "cust")
  
  ── 10. Error: estimateRegularity (@test-timing.R#15)  ──────────────────────────
  SETLENGTH() cannot be applied to an ALTVEC object.
  1: estimateRegularity(elog) at testthat/test-timing.R:15
  2: elog_dt[, `:=`(N, .N), by = "cust"]
  3: `[.data.table`(elog_dt, , `:=`(N, .N), by = "cust")
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 3 SKIPPED: 2 FAILED: 10
  1.  Error: BG/CNBD-k (@test-bg-cnbd-k.R#10) 
  2.  Error: elog2cbs (@test-elog2cbs.R#8) 
  3.  Error: elog2cum (@test-helpers.R#27) 
  4.  Error: plotTimingPatterns (@test-helpers.R#49) 
  5.  Error: MBG/CNBD-k (@test-mbg-cnbd-k.R#9) 
  6.  Error: MCMC Helpers (@test-mcmc.R#12) 
  7.  Error: NBD (@test-nbd.R#8) 
  8.  Error: Pareto/GGG MCMC (@test-pareto-ggg-mcmc.R#8) 
  9.  Error: Pareto/NBD MCMC (@test-pareto-nbd-mcmc.R#11) 
  10. Error: estimateRegularity (@test-timing.R#15) 
  
  Error: testthat unit tests failed
  Execution halted