Running 'testthat.R' [10s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(grainchanger)
  > 
  > test_check("grainchanger")
  -- 1. Error: shei calculation is correct (@test-nomove_agg.R#4)  ---------------
  invalid class "Extent" object: TRUE
  1: nomove_agg(g_sf, cat_ls, "shei", lc_class = 0:3) at testthat/test-nomove_agg.R:4
  2: furrr::future_map_dbl(sf::st_geometry(g), function(grid_cell, dat, fun, ...) {
         grid_cell <- sf::st_geometry(grid_cell)
         grid_cell_sf <- sf::st_sf(grid_cell)
         dat_cell <- raster::crop(dat, grid_cell_sf)
         value <- get(fun)(as.vector(dat_cell), ...)
     }, dat, fun, ...)
  3: future_map_template(purrr::map_dbl, "double", .x, .f, ..., .progress = .progress, 
         .options = .options)
  4: multi_resolve(fs, names(.x))
  5: values(fs)
  6: values.list(fs)
  7: value(tmp, ...)
  8: value.Future(tmp, ...)
  9: resignalConditions(future)
  
  -- 2. Error: mean calculation is correct (@test-nomove_agg.R#9)  ---------------
  invalid class "Extent" object: TRUE
  1: nomove_agg(g_sf, cont_ls, "mean") at testthat/test-nomove_agg.R:9
  2: furrr::future_map_dbl(sf::st_geometry(g), function(grid_cell, dat, fun, ...) {
         grid_cell <- sf::st_geometry(grid_cell)
         grid_cell_sf <- sf::st_sf(grid_cell)
         dat_cell <- raster::crop(dat, grid_cell_sf)
         value <- get(fun)(as.vector(dat_cell), ...)
     }, dat, fun, ...)
  3: future_map_template(purrr::map_dbl, "double", .x, .f, ..., .progress = .progress, 
         .options = .options)
  4: multi_resolve(fs, names(.x))
  5: values(fs)
  6: values.list(fs)
  7: value(tmp, ...)
  8: value.Future(tmp, ...)
  9: resignalConditions(future)
  
  -- 3. Error: output is vector of length of grid for sf input (@test-nomove_agg.R
  invalid class "Extent" object: TRUE
  1: nomove_agg(g_sf, cont_ls, "mean") at testthat/test-nomove_agg.R:15
  2: furrr::future_map_dbl(sf::st_geometry(g), function(grid_cell, dat, fun, ...) {
         grid_cell <- sf::st_geometry(grid_cell)
         grid_cell_sf <- sf::st_sf(grid_cell)
         dat_cell <- raster::crop(dat, grid_cell_sf)
         value <- get(fun)(as.vector(dat_cell), ...)
     }, dat, fun, ...)
  3: future_map_template(purrr::map_dbl, "double", .x, .f, ..., .progress = .progress, 
         .options = .options)
  4: multi_resolve(fs, names(.x))
  5: values(fs)
  6: values.list(fs)
  7: value(tmp, ...)
  8: value.Future(tmp, ...)
  9: resignalConditions(future)
  
  -- 4. Error: winmove_agg can take different grid inputs (@test-nomove_agg.R#28) 
  invalid class "Extent" object: TRUE
  1: expect_is(nomove_agg(g_sf, cont_ls, "mean"), "numeric") at testthat/test-nomove_agg.R:28
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: nomove_agg(g_sf, cont_ls, "mean")
  5: furrr::future_map_dbl(sf::st_geometry(g), function(grid_cell, dat, fun, ...) {
         grid_cell <- sf::st_geometry(grid_cell)
         grid_cell_sf <- sf::st_sf(grid_cell)
         dat_cell <- raster::crop(dat, grid_cell_sf)
         value <- get(fun)(as.vector(dat_cell), ...)
     }, dat, fun, ...)
  6: future_map_template(purrr::map_dbl, "double", .x, .f, ..., .progress = .progress, 
         .options = .options)
  7: multi_resolve(fs, names(.x))
  8: values(fs)
  9: values.list(fs)
  10: value(tmp, ...)
  11: value.Future(tmp, ...)
  12: resignalConditions(future)
  
  -- 5. Error: shei calculation is correct (@test-winmove_agg.R#4)  --------------
  invalid class "Extent" object: TRUE
  1: winmove_agg(g_sf, cat_ls, 5, "rectangle", "shei", lc_class = 0:3) at testthat/test-winmove_agg.R:4
  2: furrr::future_map_dbl(sf::st_geometry(g), function(grid_cell, dat, d, type, fun, 
         ...) {
         grid_buffer <- sf::st_buffer(grid_cell, dist = d, endCapStyle = "SQUARE", joinStyle = "MITRE", 
             mitreLimit = d/2)
         grid_buffer <- sf::st_geometry(grid_buffer)
         grid_buffer <- sf::st_sf(grid_buffer)
         dat_cell <- raster::crop(dat, grid_buffer)
         winmove_cellr <- winmove(dat_cell, d, type, fun, ...)
         mean(raster::values(winmove_cellr), na.rm = TRUE)
     }, dat, d, type, fun, ...)
  3: future_map_template(purrr::map_dbl, "double", .x, .f, ..., .progress = .progress, 
         .options = .options)
  4: multi_resolve(fs, names(.x))
  5: values(fs)
  6: values.list(fs)
  7: value(tmp, ...)
  8: value.Future(tmp, ...)
  9: resignalConditions(future)
  
  -- 6. Error: mean calculation is correct (@test-winmove_agg.R#9)  --------------
  invalid class "Extent" object: TRUE
  1: winmove_agg(g_sf, cont_ls, 5, "rectangle", "mean") at testthat/test-winmove_agg.R:9
  2: furrr::future_map_dbl(sf::st_geometry(g), function(grid_cell, dat, d, type, fun, 
         ...) {
         grid_buffer <- sf::st_buffer(grid_cell, dist = d, endCapStyle = "SQUARE", joinStyle = "MITRE", 
             mitreLimit = d/2)
         grid_buffer <- sf::st_geometry(grid_buffer)
         grid_buffer <- sf::st_sf(grid_buffer)
         dat_cell <- raster::crop(dat, grid_buffer)
         winmove_cellr <- winmove(dat_cell, d, type, fun, ...)
         mean(raster::values(winmove_cellr), na.rm = TRUE)
     }, dat, d, type, fun, ...)
  3: future_map_template(purrr::map_dbl, "double", .x, .f, ..., .progress = .progress, 
         .options = .options)
  4: multi_resolve(fs, names(.x))
  5: values(fs)
  6: values.list(fs)
  7: value(tmp, ...)
  8: value.Future(tmp, ...)
  9: resignalConditions(future)
  
  -- 7. Error: output is vector of length of input (@test-winmove_agg.R#15)  -----
  invalid class "Extent" object: TRUE
  1: winmove_agg(g_sf, cont_ls, 5, "rectangle", "mean") at testthat/test-winmove_agg.R:15
  2: furrr::future_map_dbl(sf::st_geometry(g), function(grid_cell, dat, d, type, fun, 
         ...) {
         grid_buffer <- sf::st_buffer(grid_cell, dist = d, endCapStyle = "SQUARE", joinStyle = "MITRE", 
             mitreLimit = d/2)
         grid_buffer <- sf::st_geometry(grid_buffer)
         grid_buffer <- sf::st_sf(grid_buffer)
         dat_cell <- raster::crop(dat, grid_buffer)
         winmove_cellr <- winmove(dat_cell, d, type, fun, ...)
         mean(raster::values(winmove_cellr), na.rm = TRUE)
     }, dat, d, type, fun, ...)
  3: future_map_template(purrr::map_dbl, "double", .x, .f, ..., .progress = .progress, 
         .options = .options)
  4: multi_resolve(fs, names(.x))
  5: values(fs)
  6: values.list(fs)
  7: value(tmp, ...)
  8: value.Future(tmp, ...)
  9: resignalConditions(future)
  
  -- 8. Error: winmove_agg can take different grid inputs (@test-winmove_agg.R#21)
  invalid class "Extent" object: TRUE
  1: expect_is(winmove_agg(g_sf, cont_ls, 5, "rectangle", "mean"), "numeric") at testthat/test-winmove_agg.R:21
  2: quasi_label(enquo(object), label)
  3: eval_bare(get_expr(quo), get_env(quo))
  4: winmove_agg(g_sf, cont_ls, 5, "rectangle", "mean")
  5: furrr::future_map_dbl(sf::st_geometry(g), function(grid_cell, dat, d, type, fun, 
         ...) {
         grid_buffer <- sf::st_buffer(grid_cell, dist = d, endCapStyle = "SQUARE", joinStyle = "MITRE", 
             mitreLimit = d/2)
         grid_buffer <- sf::st_geometry(grid_buffer)
         grid_buffer <- sf::st_sf(grid_buffer)
         dat_cell <- raster::crop(dat, grid_buffer)
         winmove_cellr <- winmove(dat_cell, d, type, fun, ...)
         mean(raster::values(winmove_cellr), na.rm = TRUE)
     }, dat, d, type, fun, ...)
  6: future_map_template(purrr::map_dbl, "double", .x, .f, ..., .progress = .progress, 
         .options = .options)
  7: multi_resolve(fs, names(.x))
  8: values(fs)
  9: values.list(fs)
  10: value(tmp, ...)
  11: value.Future(tmp, ...)
  12: resignalConditions(future)
  
  == testthat results  ===========================================================
  OK: 7 SKIPPED: 0 FAILED: 8
  1. Error: shei calculation is correct (@test-nomove_agg.R#4) 
  2. Error: mean calculation is correct (@test-nomove_agg.R#9) 
  3. Error: output is vector of length of grid for sf input (@test-nomove_agg.R#15) 
  4. Error: winmove_agg can take different grid inputs (@test-nomove_agg.R#28) 
  5. Error: shei calculation is correct (@test-winmove_agg.R#4) 
  6. Error: mean calculation is correct (@test-winmove_agg.R#9) 
  7. Error: output is vector of length of input (@test-winmove_agg.R#15) 
  8. Error: winmove_agg can take different grid inputs (@test-winmove_agg.R#21) 
  
  Error: testthat unit tests failed
  Execution halted