Running ‘testthat.R’ [5s/7s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(fasterize)
  
  Attaching package: 'fasterize'
  
  The following object is masked from 'package:graphics':
  
      plot
  
  > 
  > test_check("fasterize")
  ── 1. Failure: fasterize works (@test-02-fasterize.R#20)  ──────────────────────
  `f <- fasterize(pols, r, field = "value", fun = "sum")` threw an error.
  Message: Index out of bounds: [index='proj4string'].
  Class:   Rcpp::index_out_of_bounds/C++Error/error/condition
  Backtrace:
   1. testthat::expect_error(...)
   6. fasterize::fasterize(pols, r, field = "value", fun = "sum")
  
  ── 2. Failure: fasterize works (@test-02-fasterize.R#21)  ──────────────────────
  `f <- fasterize(pols, r, fun = "sum")` threw an error.
  Message: Index out of bounds: [index='proj4string'].
  Class:   Rcpp::index_out_of_bounds/C++Error/error/condition
  Backtrace:
   1. testthat::expect_error(...)
   6. fasterize::fasterize(pols, r, fun = "sum")
  
  ── 3. Error: fasterize works (@test-02-fasterize.R#22)  ────────────────────────
  object 'f' not found
  Backtrace:
   1. testthat::expect_s4_class(f, "RasterLayer")
   2. testthat::quasi_label(enquo(object), arg = "object")
   3. rlang::eval_bare(expr, quo_get_env(quo))
  
  ── 4. Failure: non-NA background values allowed (@test-02-fasterize.R#28)  ─────
  `f0 <- fasterize(pols, r, field = "value", fun = "last", background = bg)` threw an error.
  Message: Index out of bounds: [index='proj4string'].
  Class:   Rcpp::index_out_of_bounds/C++Error/error/condition
  Backtrace:
   1. testthat::expect_error(...)
   6. fasterize::fasterize(...)
  
  ── 5. Error: non-NA background values allowed (@test-02-fasterize.R#30)  ───────
  object 'f0' not found
  Backtrace:
   1. testthat::expect_equal(unname(f0[1, 1]), bg)
   4. base::unname(f0[1, 1])
  
  ── 6. Error: projections handled properly (@test-02-fasterize.R#40)  ───────────
  Index out of bounds: [index='proj4string'].
  Backtrace:
   1. fasterize::fasterize(nc, r1, field = "AREA", fun = "first")
  
  ── 7. Error: values are correct when polygons extend beyond raster (@test-02-fas
  Index out of bounds: [index='proj4string'].
  Backtrace:
   1. fasterize::fasterize(pols, r1, field = "value", fun = "sum")
  
  ── 8. Error: sum function works (@test-04-funs.R#21)  ──────────────────────────
  Index out of bounds: [index='proj4string'].
  Backtrace:
   1. fasterize::fasterize(pols, r, field = "value", fun = funs[i])
  
  ── 9. Error: sum function works (@test-04-funs.R#21)  ──────────────────────────
  Index out of bounds: [index='proj4string'].
  Backtrace:
   1. fasterize::fasterize(pols, r, field = "value", fun = funs[i])
  
  ── 10. Error: sum function works (@test-04-funs.R#21)  ─────────────────────────
  Index out of bounds: [index='proj4string'].
  Backtrace:
   1. fasterize::fasterize(pols, r, field = "value", fun = funs[i])
  
  ── 11. Error: sum function works (@test-04-funs.R#21)  ─────────────────────────
  Index out of bounds: [index='proj4string'].
  Backtrace:
   1. fasterize::fasterize(pols, r, field = "value", fun = funs[i])
  
  ── 12. Error: sum function works (@test-04-funs.R#21)  ─────────────────────────
  Index out of bounds: [index='proj4string'].
  Backtrace:
   1. fasterize::fasterize(pols, r, field = "value", fun = funs[i])
  
  ── 13. Error: sum function works (@test-04-funs.R#21)  ─────────────────────────
  Index out of bounds: [index='proj4string'].
  Backtrace:
   1. fasterize::fasterize(pols, r, field = "value", fun = funs[i])
  
  ── 14. Error: sum function works (@test-04-funs.R#21)  ─────────────────────────
  Index out of bounds: [index='proj4string'].
  Backtrace:
   1. fasterize::fasterize(pols, r, field = "value", fun = funs[i])
  
  ── 15. Failure: 'by' argument works (@test-05-by.R#19)  ────────────────────────
  `rb <- fasterize(pols, r1, field = "value", fun = "sum", by = "by_1")` threw an error.
  Message: Index out of bounds: [index='proj4string'].
  Class:   Rcpp::index_out_of_bounds/C++Error/error/condition
  Backtrace:
   1. testthat::expect_error(...)
   6. fasterize::fasterize(...)
  
  ── 16. Error: 'by' argument works (@test-05-by.R#21)  ──────────────────────────
  object 'rb' not found
  Backtrace:
   1. testthat::expect_equal(names(rb), unique(pols$by_1))
   2. testthat::quasi_label(enquo(object), label, arg = "object")
   3. rlang::eval_bare(expr, quo_get_env(quo))
  
  ── 17. Error: 'by' layers are equivalent to layers generated separately (@test-0
  Index out of bounds: [index='proj4string'].
  Backtrace:
   1. fasterize::fasterize(...)
  
  ── 18. Failure: 'by' can handle non-character fields (@test-05-by.R#33)  ───────
  `rb_n <- fasterize(pols, r1, field = "value", fun = "sum", by = "by_2")` threw an error.
  Message: Index out of bounds: [index='proj4string'].
  Class:   Rcpp::index_out_of_bounds/C++Error/error/condition
  Backtrace:
   1. testthat::expect_error(...)
   6. fasterize::fasterize(...)
  
  ── 19. Failure: 'by' can handle non-character fields (@test-05-by.R#35)  ───────
  `rb_f <- fasterize(pols, r1, field = "value", fun = "sum", by = "by_3")` threw an error.
  Message: Index out of bounds: [index='proj4string'].
  Class:   Rcpp::index_out_of_bounds/C++Error/error/condition
  Backtrace:
   1. testthat::expect_error(...)
   6. fasterize::fasterize(...)
  
  ── 20. Error: 'by' can handle non-character fields (@test-05-by.R#37)  ─────────
  object 'rb_n' not found
  Backtrace:
   1. testthat::expect_equal(rb_n@data@names, unique(as.character(pols$by_2)))
   2. testthat::quasi_label(enquo(object), label, arg = "object")
   3. rlang::eval_bare(expr, quo_get_env(quo))
  
  ── 21. Failure: non-NA background values allowed with by (@test-05-by.R#44)  ───
  `... <- NULL` threw an error.
  Message: Index out of bounds: [index='proj4string'].
  Class:   Rcpp::index_out_of_bounds/C++Error/error/condition
  Backtrace:
   1. testthat::expect_error(...)
   6. fasterize::fasterize(...)
  
  ── 22. Error: non-NA background values allowed with by (@test-05-by.R#47)  ─────
  object 'f0' not found
  Backtrace:
   1. testthat::expect_equal(unname(f0[[1]][1, 1]), bg)
   4. base::unname(f0[[1]][1, 1])
  
  ── 23. Error: projections handled properly with by (@test-05-by.R#57)  ─────────
  Index out of bounds: [index='proj4string'].
  Backtrace:
   1. fasterize::fasterize(nc, r1, field = "AREA", fun = "first", by = "CNTY_ID")
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  [ OK: 9 | SKIPPED: 0 | WARNINGS: 20 | FAILED: 23 ]
  1. Failure: fasterize works (@test-02-fasterize.R#20) 
  2. Failure: fasterize works (@test-02-fasterize.R#21) 
  3. Error: fasterize works (@test-02-fasterize.R#22) 
  4. Failure: non-NA background values allowed (@test-02-fasterize.R#28) 
  5. Error: non-NA background values allowed (@test-02-fasterize.R#30) 
  6. Error: projections handled properly (@test-02-fasterize.R#40) 
  7. Error: values are correct when polygons extend beyond raster (@test-02-fasterize.R#64) 
  8. Error: sum function works (@test-04-funs.R#21) 
  9. Error: sum function works (@test-04-funs.R#21) 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted