Running ‘testthat.R’ [43s/43s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > if (require("testthat")) {
  +     test_check("surveillance")
  + }
  Loading required package: testthat
  Loading required package: surveillance
  Loading required package: sp
  Loading required package: xtable
  This is surveillance 1.16.2. For overview type 'help(surveillance)'.
  
  Penalized log-likelihood:
  Checking analytical score vector using numDeriv::grad() ...
  [1] TRUE
  Checking analytical Fisher information matrix using numDeriv::hessian() ...
  [1] "Mean relative difference: 3.802109e-07"
  
  Penalized log-likelihood:
  Checking analytical score vector using numDeriv::grad() ...
  [1] TRUE
  Checking analytical Fisher information matrix using numDeriv::hessian() ...
  [1] "Mean relative difference: 1.551014e-07"
  'F' vs. cubature using method = "midpoint" ... ── 1. Error: Gaussian 'F.adaptive' implementation agrees with numerical approxim
  inapplicable choice of bandwidth (eps=0.025) in midpoint rule:
  no applicable method for 'set_units' applied to an object of class "character"
  1: myexpectation(siaf.gaussian(F.adaptive = 0.05), pargrid = as.matrix(log(c(0.5, 1, 
         3))), tolerance = 0.01, method = "midpoint", dimyx = 150)
  2: surveillance:::checksiaf(siaf, pargrid, type, ...) at testthat/test-siafs.R:25
  3: checksiaf.F(siaf$F, siaf$f, pargrid, type = type, method = method, ...)
  4: t(apply(pargrid, 1, function(pars) {
         given <- F(LETTERR, f, pars, type)
         num <- siaf.fallback.F(polydomain = LETTERR, f = f, pars = pars, type = type, 
             method = method, ...)
         c(given, num)
     }))
  5: apply(pargrid, 1, function(pars) {
         given <- F(LETTERR, f, pars, type)
         num <- siaf.fallback.F(polydomain = LETTERR, f = f, pars = pars, type = type, 
             method = method, ...)
         c(given, num)
     })
  6: FUN(newX[, i], ...)
  7: F(LETTERR, f, pars, type)
  8: polyCub.midpoint(polydomain, f, pars, type, eps = eps)
  9: tryCatch(spatstat::as.im.function(X = fxy, W = polyregion, ..., eps = eps, dimyx = dimyx), 
         error = function(e) {
             stop("inapplicable choice of bandwidth (eps=", format(eps), ") in midpoint rule:\n", 
                 e)
         })
  10: tryCatchList(expr, classes, parentenv, handlers)
  11: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  12: value[[3L]](cond)
  13: stop("inapplicable choice of bandwidth (eps=", format(eps), ") in midpoint rule:\n", 
         e)
  
  'F' vs. cubature using method = "SV" ... TRUE 
  'Fcircle' vs. cubature using method = "SV" ... TRUE 
  'deriv' vs. numerical derivative ... TRUE 
  'Deriv' vs. cubature using method = "SV" ... TRUE 
  Checking 'intrfr' against a numeric approximation ... OK
  Checking 'intrfr' against a numeric approximation ... OK
  Checking 'intrfr' against a numeric approximation ... OK
  Checking 'intrfr' against a numeric approximation ... OK
  Checking 'intrfr' against a numeric approximation ... OK
  Checking 'intrfr' against a numeric approximation ... OK
  Checking 'intrfr' against a numeric approximation ... OK
  Checking 'intrfr' against a numeric approximation ... OK
  Checking 'intrfr' against a numeric approximation ... OK
  'F' vs. cubature using method = "SV" ... TRUE 
  'Fcircle' vs. cubature using method = "SV" ... TRUE 
  'deriv' vs. numerical derivative ... TRUE 
  'Deriv' vs. cubature using method = "SV" ... 
  	siaf parameter 1: TRUE 
  	siaf parameter 2: TRUE 
  Checking 'intrfr' against a numeric approximation ... OK
  Checking 'intrfr' against a numeric approximation ... OK
  Checking 'intrfr' against a numeric approximation ... OK
  Checking 'intrfr' against a numeric approximation ... OK
  Checking 'intrfr' against a numeric approximation ... OK
  Checking 'intrfr' against a numeric approximation ... OK
  Checking 'intrfr' against a numeric approximation ... OK
  Checking 'intrfr' against a numeric approximation ... OK
  Checking 'intrfr' against a numeric approximation ... OK
  'F' vs. cubature using method = "midpoint" ... ── 2. Error: Lagged power-law implementation agrees with numeric results (@test-
  inapplicable choice of bandwidth (eps=NULL) in midpoint rule:
  no applicable method for 'set_units' applied to an object of class "character"
  1: myexpectation(siaf.powerlawL(engine = "R"), surveillance:::intrfr.powerlawL, list(surveillance:::intrfr.powerlawL.dlogsigma, 
         surveillance:::intrfr.powerlawL.dlogd), pargrid = cbind(-0.5, log(c(0.1, 1, 2))), 
         tolerance = 0.01, method = "midpoint", dimyx = 150)
  2: surveillance:::checksiaf(siaf, pargrid, type, ...) at testthat/test-siafs.R:25
  3: checksiaf.F(siaf$F, siaf$f, pargrid, type = type, method = method, ...)
  4: t(apply(pargrid, 1, function(pars) {
         given <- F(LETTERR, f, pars, type)
         num <- siaf.fallback.F(polydomain = LETTERR, f = f, pars = pars, type = type, 
             method = method, ...)
         c(given, num)
     }))
  5: apply(pargrid, 1, function(pars) {
         given <- F(LETTERR, f, pars, type)
         num <- siaf.fallback.F(polydomain = LETTERR, f = f, pars = pars, type = type, 
             method = method, ...)
         c(given, num)
     })
  6: FUN(newX[, i], ...)
  7: siaf.fallback.F(polydomain = LETTERR, f = f, pars = pars, type = type, method = method, 
         ...)
  8: polyCub(polyregion = polydomain, f = f, method = method, pars, type, ...)
  9: eval(cl, parent.frame())
  10: eval(cl, parent.frame())
  11: polyCub::polyCub.midpoint(polyregion = polydomain, f = f, pars, type, dimyx = 150)
  12: tryCatch(spatstat::as.im.function(X = fxy, W = polyregion, ..., eps = eps, dimyx = dimyx), 
         error = function(e) {
             stop("inapplicable choice of bandwidth (eps=", format(eps), ") in midpoint rule:\n", 
                 e)
         })
  13: tryCatchList(expr, classes, parentenv, handlers)
  14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  15: value[[3L]](cond)
  16: stop("inapplicable choice of bandwidth (eps=", format(eps), ") in midpoint rule:\n", 
         e)
  
  Checking 'intrfr' against a numeric approximation ... OK
  Checking 'intrfr' against a numeric approximation ... OK
  Checking 'intrfr' against a numeric approximation ... OK
  Checking 'intrfr' against a numeric approximation ... OK
  Checking 'intrfr' against a numeric approximation ... OK
  Checking 'intrfr' against a numeric approximation ... OK
  Checking 'intrfr' against a numeric approximation ... OK
  Checking 'intrfr' against a numeric approximation ... OK
  Checking 'intrfr' against a numeric approximation ... OK
  'F' vs. cubature using method = "SV" ... TRUE 
  'deriv' vs. numerical derivative ... TRUE 
  'Deriv' vs. cubature using method = "SV" ... 
  	siaf parameter 1: TRUE 
  	siaf parameter 2: TRUE 
  'F' vs. cubature using method = "midpoint" ... ── 3. Error: Step kernel implementation agrees with numerical approximation (@te
  no applicable method for 'set_units' applied to an object of class "character"
  1: myexpectation(siaf.step(c(0.1, 0.5, 1)), pargrid = -t(c(0.5, 0.1, 0.2)), tolerance = 0.01, 
         method = "midpoint", dimyx = 150)
  2: surveillance:::checksiaf(siaf, pargrid, type, ...) at testthat/test-siafs.R:25
  3: checksiaf.F(siaf$F, siaf$f, pargrid, type = type, method = method, ...)
  4: t(apply(pargrid, 1, function(pars) {
         given <- F(LETTERR, f, pars, type)
         num <- siaf.fallback.F(polydomain = LETTERR, f = f, pars = pars, type = type, 
             method = method, ...)
         c(given, num)
     }))
  5: apply(pargrid, 1, function(pars) {
         given <- F(LETTERR, f, pars, type)
         num <- siaf.fallback.F(polydomain = LETTERR, f = f, pars = pars, type = type, 
             method = method, ...)
         c(given, num)
     })
  6: FUN(newX[, i], ...)
  7: F(LETTERR, f, pars, type)
  8: ringAreas(polydomain, npoly = npoly)
  9: withVisible(`_f`(polydomain = polydomain, npoly = npoly))
  10: `_f`(polydomain = polydomain, npoly = npoly)
  ...
  15: as.owin.owin(x)
  16: owin(W$xrange, W$yrange, poly = W$bdry, mask = W$m, unitname = unitname(W), check = FALSE)
  17: as.unitname(unitname)
  18: unitname(W)
  19: unitname.owin(W)
  20: as.unitname(x$units)
  21: as.list(s)
  22: as.list.units(s)
  23: mapply(set_units, unclass(x), x, mode = "standard", SIMPLIFY = FALSE)
  24: (function (x, value, ..., mode = units_options("set_units_mode")) 
     UseMethod("set_units"))(dots[[1L]][[1L]], dots[[2L]][[1L]], mode = dots[[3L]][[1L]])
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 250 SKIPPED: 0 FAILED: 3
  1. Error: Gaussian 'F.adaptive' implementation agrees with numerical approximation (@test-siafs.R#25) 
  2. Error: Lagged power-law implementation agrees with numeric results (@test-siafs.R#25) 
  3. Error: Step kernel implementation agrees with numerical approximation (@test-siafs.R#25) 
  
  Error: testthat unit tests failed
  Execution halted