Running ‘testthat.R’ [29s/44s]
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
  Loading required package: polyCub
  This is surveillance 1.15.0. For overview type 'help(surveillance)'.
  ── 1. Error: (unknown) (@test-formatDate.R#61)  ────────────────────────────────
  invalid 'trim' argument
  1: test_that(formatDate(d2, "%q"), equals(c("1", "31"))) at testthat/test-formatDate.R:61
  2: test_code(desc, code, env = parent.frame())
  3: formatDate(d2, "%q")
  4: sapply(x, function(date) {
         modQ <- (as.numeric(format(date, "%m")) - 1)%%3
         dateInMonth <- seq(date, length.out = 2, by = paste0("-", modQ, " month"))[2]
         return(dateInMonth - as.numeric(format(dateInMonth, "%d")) + 1)
     })
  5: lapply(X = X, FUN = FUN, ...)
  6: FUN(X[[i]], ...)
  7: format(date, "%m")
  8: format.default(date, "%m")
  9: prettyNum(.Internal(format(x, trim, digits, nsmall, width, 3L, na.encode, scientific, 
         decimal.mark)), big.mark = big.mark, big.interval = big.interval, small.mark = small.mark, 
         small.interval = small.interval, decimal.mark = decimal.mark, input.d.mark = decimal.mark, 
         zero.print = zero.print, drop0trailing = drop0trailing, is.cmplx = is.complex(x), 
         preserve.width = if (trim) "individual" else "common")
  
  
  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.881263e-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" ... TRUE 
  'Fcircle' vs. cubature using method = "midpoint" ... TRUE 
  'deriv' vs. numerical derivative ... TRUE 
  'Deriv' vs. cubature using method = "midpoint" ... TRUE 
  '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" ... TRUE 
  'Fcircle' vs. cubature using method = "midpoint" ... TRUE 
  'deriv' vs. numerical derivative ... TRUE 
  'Deriv' vs. cubature using method = "midpoint" ... 
  	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 = "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" ... TRUE 
  'Fcircle' vs. cubature using method = "midpoint" ... TRUE 
  'deriv' vs. numerical derivative ... TRUE 
  'Deriv' vs. cubature using method = "midpoint" ... 
  	siaf parameter 1: TRUE 
  	siaf parameter 2: TRUE 
  	siaf parameter 3: TRUE 
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 248 SKIPPED: 1 FAILED: 1
  1. Error: (unknown) (@test-formatDate.R#61) 
  
  Error: testthat unit tests failed
  Execution halted