Running ‘testthat.R’ [160s/237s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(ForestTools)
  ForestTools 0.2.1 backwards compability warning: see NEWS file
  > 
  > test_check("ForestTools")
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error (test_sp_summarise.R:72:5): sp_summarise: Expected results using overlapping areas ──
  Error: more elements supplied than there are to replace
  Backtrace:
      █
   1. └─ForestTools::sp_summarise(...) test_sp_summarise.R:72:4
   2.   ├─base::lapply(sp::over(areas, trees, returnList = TRUE), row.names)
   3.   ├─sp::over(areas, trees, returnList = TRUE)
   4.   └─sp::over(areas, trees, returnList = TRUE)
   5.     └─sp:::.local(x, y, returnList, fn, ...)
   6.       ├─sp::over(x, geometry(y), returnList = TRUE, minDimension = minDimension)
   7.       └─sp::over(x, geometry(y), returnList = TRUE, minDimension = minDimension)
   8.         └─sp:::pointsInSpatialPolygons(geometry(y), geometry(x), TRUE)
   9.           └─sp:::pointsInPolys2(...)
  ── Error (test_sp_summarise.R:92:5): sp_summarise: Expect that area with no treetops returns all NA values ──
  Error: more elements supplied than there are to replace
  Backtrace:
      █
   1. └─ForestTools::sp_summarise(...) test_sp_summarise.R:92:4
   2.   ├─base::lapply(sp::over(areas, trees, returnList = TRUE), row.names)
   3.   ├─sp::over(areas, trees, returnList = TRUE)
   4.   └─sp::over(areas, trees, returnList = TRUE)
   5.     └─sp:::.local(x, y, returnList, fn, ...)
   6.       ├─sp::over(x, geometry(y), returnList = TRUE, minDimension = minDimension)
   7.       └─sp::over(x, geometry(y), returnList = TRUE, minDimension = minDimension)
   8.         └─sp:::pointsInSpatialPolygons(geometry(y), geometry(x), TRUE)
   9.           └─sp:::pointsInPolys2(...)
  ── Error (test_sp_summarise.R:104:5): sp_summarise: Expect a warning if no areas contain treetops ──
  Error: 'names' attribute [3] must be the same length as the vector [0]
  Backtrace:
       █
    1. ├─testthat::expect_warning(...) test_sp_summarise.R:104:4
    2. │ └─testthat:::quasi_capture(enquo(object), label, capture_warnings)
    3. │   ├─testthat:::.capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. └─ForestTools::sp_summarise(...)
    7.   ├─base::lapply(sp::over(areas, trees, returnList = TRUE), row.names)
    8.   ├─sp::over(areas, trees, returnList = TRUE)
    9.   └─sp::over(areas, trees, returnList = TRUE)
   10.     └─sp:::.local(x, y, returnList, fn, ...)
   11.       ├─sp::over(x, geometry(y), returnList = TRUE, minDimension = minDimension)
   12.       └─sp::over(x, geometry(y), returnList = TRUE, minDimension = minDimension)
  ── Error (test_sp_summarise.R:208:5): sp_summarise: Custom functions meeting conditions work properly ──
  Error: more elements supplied than there are to replace
  Backtrace:
      █
   1. └─ForestTools::sp_summarise(...) test_sp_summarise.R:208:4
   2.   ├─base::lapply(sp::over(areas, trees, returnList = TRUE), row.names)
   3.   ├─sp::over(areas, trees, returnList = TRUE)
   4.   └─sp::over(areas, trees, returnList = TRUE)
   5.     └─sp:::.local(x, y, returnList, fn, ...)
   6.       ├─sp::over(x, geometry(y), returnList = TRUE, minDimension = minDimension)
   7.       └─sp::over(x, geometry(y), returnList = TRUE, minDimension = minDimension)
   8.         └─sp:::pointsInSpatialPolygons(geometry(y), geometry(x), TRUE)
   9.           └─sp:::pointsInPolys2(...)
  
  [ FAIL 4 | WARN 0 | SKIP 0 | PASS 57 ]
  Error: Test failures
  Execution halted