Package: amadeus Check: examples New result: ERROR Running examples in ‘amadeus-Ex.R’ failed The error most likely occurred in: > base::assign(".ptime", proc.time(), pos = "CheckExEnv") > ### Name: download_merra2 > ### Title: Download meteorological and atmospheric data > ### Aliases: download_merra2 > > ### ** Examples > > download_merra2( + collection = "inst1_2d_int_Nx", + date = c("2024-01-01", "2024-01-01"), + directory_to_save = tempdir(), + acknowledgement = TRUE, + download = FALSE, # NOTE: download skipped for examples, + remove_command = TRUE + ) Error in curl::curl_fetch_memory(url, handle = handle) : Timeout was reached: [goldsmr4.gesdisc.eosdis.nasa.gov] Failed to connect to goldsmr4.gesdisc.eosdis.nasa.gov port 443 after 10004 ms: Could not connect to server Calls: download_merra2 ... request_fetch -> request_fetch.write_memory -> Execution halted Package: BFS Check: tests New result: ERROR Running ‘testthat.R’ [19s/161s] Running the tests in ‘tests/testthat.R’ failed. Complete output: > # This file is part of the standard setup for testthat. > # It is recommended that you do not modify it. > # > # Where should you do additional test configuration? > # Learn more about the roles of various files in: > # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview > # * https://testthat.r-lib.org/articles/special-files.html > > library(testthat) > library(BFS) > > test_check("BFS") ==>---------------------------- 5% | ETA: 40s ===>--------------------------- 11% | ETA: 38s =====>------------------------- 18% | ETA: 36s ========>---------------------- 25% | ETA: 33s ==========>-------------------- 32% | ETA: 29s ============>------------------ 39% | ETA: 27s ==============>---------------- 45% | ETA: 24s ================>-------------- 52% | ETA: 21s ==================>------------ 59% | ETA: 18s ====================>---------- 66% | ETA: 15s =====================>--------- 71% | ETA: 13s ========================>------ 78% | ETA: 10s =========================>----- 84% | ETA: 7s ===========================>--- 91% | ETA: 4s =============================>- 97% | ETA: 1s [ FAIL 7 | WARN 1 | SKIP 0 | PASS 38 ] ══ Failed tests ════════════════════════════════════════════════════════════════ ── Error ('test-bfs_get_base_maps.R:5:3'): Get Switzerland base map data as sf works ── Error in `zip::unzip(zipfile = paste0(path_base_map, ".zip"), junkpaths = TRUE, exdir = path_base_map)`: zip error: Cannot open zip file `/home/hornik/tmp/scratch/check-CRAN-incoming-hornik/data/R/BFS/base_maps_24025646.zip` for reading in file zip.c:141 Backtrace: ▆ 1. └─BFS::bfs_get_base_maps(geom = "suis") at test-bfs_get_base_maps.R:5:3 2. └─zip::unzip(...) ── Error ('test-bfs_get_base_maps.R:13:3'): Get Cantons base map data as sf works ── Error in `if (nchar(dsn) < 1) stop("`dsn` must point to a source, not an empty string.", call. = FALSE)`: missing value where TRUE/FALSE needed Backtrace: ▆ 1. └─BFS::bfs_get_base_maps(geom = "kant") at test-bfs_get_base_maps.R:13:3 2. └─sf::read_sf(file_selected) 3. ├─sf::st_read(...) 4. └─sf:::st_read.character(...) ── Error ('test-bfs_get_base_maps.R:21:3'): Get Canton Capitals base map data as sf works ── Error in `if (nchar(dsn) < 1) stop("`dsn` must point to a source, not an empty string.", call. = FALSE)`: missing value where TRUE/FALSE needed Backtrace: ▆ 1. └─BFS::bfs_get_base_maps(geom = "stkt", type = "Pnts", category = "kk") at test-bfs_get_base_maps.R:21:3 2. └─sf::read_sf(file_selected) 3. ├─sf::st_read(...) 4. └─sf:::st_read.character(...) ── Error ('test-bfs_get_base_maps.R:29:3'): Get Lake base map data as sf works ── Error in `if (nchar(dsn) < 1) stop("`dsn` must point to a source, not an empty string.", call. = FALSE)`: missing value where TRUE/FALSE needed Backtrace: ▆ 1. └─BFS::bfs_get_base_maps(geom = "seen", category = "11") at test-bfs_get_base_maps.R:29:3 2. └─sf::read_sf(file_selected) 3. ├─sf::st_read(...) 4. └─sf:::st_read.character(...) ── Error ('test-bfs_get_base_maps.R:43:3'): bfs_get_base_maps() with gf_ch category ── Error in `if (nchar(dsn) < 1) stop("`dsn` must point to a source, not an empty string.", call. = FALSE)`: missing value where TRUE/FALSE needed Backtrace: ▆ 1. └─BFS::bfs_get_base_maps(geom = "suis", category = "gf_ch") at test-bfs_get_base_maps.R:43:3 2. └─sf::read_sf(file_selected) 3. ├─sf::st_read(...) 4. └─sf:::st_read.character(...) ── Error ('test-bfs_get_base_maps.R:51:3'): bfs_get_base_maps() with 'polg' geom and date ── Error in `if (nchar(dsn) < 1) stop("`dsn` must point to a source, not an empty string.", call. = FALSE)`: argument is of length zero Backtrace: ▆ 1. └─BFS::bfs_get_base_maps(geom = "polg", date = "20230101") at test-bfs_get_base_maps.R:51:3 2. └─sf::read_sf(file_selected) 3. ├─sf::st_read(...) 4. └─sf:::st_read.character(...) ── Error ('test-bfs_get_base_maps.R:59:3'): bfs_get_base_maps() with 'polg' geom and recent date different ── Error in `if (nchar(dsn) < 1) stop("`dsn` must point to a source, not an empty string.", call. = FALSE)`: missing value where TRUE/FALSE needed Backtrace: ▆ 1. └─BFS::bfs_get_base_maps(geom = "kant", most_recent = TRUE) at test-bfs_get_base_maps.R:59:3 2. └─sf::read_sf(file_selected) 3. ├─sf::st_read(...) 4. └─sf:::st_read.character(...) [ FAIL 7 | WARN 1 | SKIP 0 | PASS 38 ] Error: Test failures Execution halted Package: mapme.biodiversity Check: tests New result: ERROR Running ‘testthat.R’ [47s/76s] Running the tests in ‘tests/testthat.R’ failed. Complete output: > library(testthat) > library(mapme.biodiversity) > > options(pillar.advice = FALSE) > mapme_options(verbose = FALSE) > test_check("mapme.biodiversity") Attaching package: 'purrr' The following object is masked from 'package:testthat': is_null Resource 'gsw_time_series' is already available. Resource 'gfw_treecover' is already available. Resource 'gfw_lossyear' is already available. [ FAIL 16 | WARN 0 | SKIP 34 | PASS 458 ] ══ Skipped tests (34) ══════════════════════════════════════════════════════════ • On CRAN (34): 'test-calc_burned_area.R:2:3', 'test-calc_drought_indicator.R:49:3', 'test-calc_elevation.R:39:3', 'test-calc_landcover.R:2:3', 'test-calc_population_count.R:34:3', 'test-calc_precipitation_chelsa.R:36:3', 'test-calc_precipitation_chirps.R:2:3', 'test-calc_slope.R:51:3', 'test-calc_soilproperties.R:2:3', 'test-calc_traveltime.R:38:3', 'test-calc_treecover_area.R:97:3', 'test-calc_treecover_area_and_emissions.R:30:3', 'test-calc_treecoverloss_emissions.R:27:3', 'test-calc_tri.R:33:3', 'test-get_carbon.R:28:3', 'test-get_chirps.R:2:3', 'test-get_esalandcover.R:2:3', 'test-get_fritz_et_al.R:2:3', 'test-get_gfw_emissions.R:2:3', 'test-get_gfw_lossyear.R:2:3', 'test-get_gfw_treecover.R:7:3', 'test-get_gmw.R:2:3', 'test-get_gsw.R:2:3', 'test-get_hfp.R:10:3', 'test-get_mcd64A1.R:2:3', 'test-get_nasa_grace.R:2:3', 'test-get_nasa_srtm.R:2:3', 'test-get_nelson_et_al.R:2:3', 'test-get_resources.R:2:3', 'test-get_soilgrids.R:2:3', 'test-get_teow.R:2:3', 'test-get_ucdp_ged.R:3:3', 'test-get_worldpop.R:2:3', 'test-ipbes.R:2:3' ══ Failed tests ════════════════════════════════════════════════════════════════ ── Error ('test-calc_fatalities.R:12:3'): .calc_fatalities works ─────────────── Error in `purrr::map(resources, function(resource) { resource <- avail_resources[[resource]] resource_type <- unique(resource[["type"]]) reader <- switch(resource_type, raster = .read_raster, vector = .read_vector, stop(sprintf("Resource type '%s' currently not supported", resource_type))) reader(x, resource, mode) })`: i In index: 1. Caused by error in `scan()`: ! scan() expected 'a real', got 'IllegalArgumentException:' Backtrace: ▆ 1. ├─mapme.biodiversity::prep_resources(x) at test-calc_fatalities.R:12:3 2. │ └─purrr::map(...) 3. │ └─purrr:::map_("list", .x, .f, ..., .progress = .progress) 4. │ ├─purrr:::with_indexed_errors(...) 5. │ │ └─base::withCallingHandlers(...) 6. │ ├─purrr:::call_with_cleanup(...) 7. │ └─mapme.biodiversity (local) .f(.x[[i]], ...) 8. │ └─mapme.biodiversity (local) reader(x, resource, mode) 9. │ └─mapme.biodiversity:::.get_intersection(x, tindex) 10. │ ├─base::suppressMessages(targets <- st_intersects(x, tindex, sparse = FALSE)) 11. │ │ └─base::withCallingHandlers(...) 12. │ ├─sf::st_intersects(x, tindex, sparse = FALSE) 13. │ └─sf:::st_intersects.sf(x, tindex, sparse = FALSE) 14. │ └─sf:::st_geos_binop(...) 15. │ └─sf:::CPL_geos_binop(...) 16. ├─sf (local) ``("IllegalArgumentException: Invalid number of points in LinearRing found 2 - must be 0 or >= 3") 17. │ └─base::scan(text = lst[[length(lst)]], quiet = TRUE) 18. └─base::.handleSimpleError(...) 19. └─purrr (local) h(simpleError(msg, call)) 20. └─cli::cli_abort(...) 21. └─rlang::abort(...) ── Error ('test-calc_fatalities.R:12:3'): .calc_fatalities works ─────────────── Error in `purrr::map(resources, function(resource) { resource <- avail_resources[[resource]] resource_type <- unique(resource[["type"]]) reader <- switch(resource_type, raster = .read_raster, vector = .read_vector, stop(sprintf("Resource type '%s' currently not supported", resource_type))) reader(x, resource, mode) })`: i In index: 1. Caused by error: ! IllegalArgumentException: Invalid number of points in LinearRing found 2 - must be 0 or >= 3 Backtrace: ▆ 1. ├─mapme.biodiversity::prep_resources(x) at test-calc_fatalities.R:12:3 2. │ └─purrr::map(...) 3. │ └─purrr:::map_("list", .x, .f, ..., .progress = .progress) 4. │ ├─purrr:::with_indexed_errors(...) 5. │ │ └─base::withCallingHandlers(...) 6. │ ├─purrr:::call_with_cleanup(...) 7. │ └─mapme.biodiversity (local) .f(.x[[i]], ...) 8. │ └─mapme.biodiversity (local) reader(x, resource, mode) 9. │ └─mapme.biodiversity:::.get_intersection(x, tindex) 10. │ ├─base::suppressMessages(targets <- st_intersects(x, tindex, sparse = FALSE)) 11. │ │ └─base::withCallingHandlers(...) 12. │ ├─sf::st_intersects(x, tindex, sparse = FALSE) 13. │ └─sf:::st_intersects.sf(x, tindex, sparse = FALSE) 14. │ └─sf:::st_geos_binop(...) 15. │ └─sf:::CPL_geos_binop(...) 16. ├─sf (local) ``("IllegalArgumentException: Invalid number of points in LinearRing found 2 - must be 0 or >= 3") 17. │ └─base::stop(msg) 18. └─base::.handleSimpleError(...) 19. └─purrr (local) h(simpleError(msg, call)) 20. └─cli::cli_abort(...) 21. └─rlang::abort(...) ── Error ('test-calc_indicator.R:241:3'): .read_raster works correctly ───────── Error in `scan(text = lst[[length(lst)]], quiet = TRUE)`: scan() expected 'a real', got 'IllegalArgumentException:' Backtrace: ▆ 1. ├─mapme.biodiversity:::.read_raster(x, footprints) at test-calc_indicator.R:241:3 2. │ └─mapme.biodiversity:::.get_intersection(x, tindex) 3. │ ├─base::suppressMessages(targets <- st_intersects(x, tindex, sparse = FALSE)) 4. │ │ └─base::withCallingHandlers(...) 5. │ ├─sf::st_intersects(x, tindex, sparse = FALSE) 6. │ └─sf:::st_intersects.sfc(x, tindex, sparse = FALSE) 7. │ └─sf:::st_geos_binop(...) 8. │ └─sf:::CPL_geos_binop(...) 9. └─sf (local) ``("IllegalArgumentException: Invalid number of points in LinearRing found 2 - must be 0 or >= 3") 10. └─base::scan(text = lst[[length(lst)]], quiet = TRUE) ── Error ('test-calc_indicator.R:241:3'): .read_raster works correctly ───────── Error in `(function (msg) { on.exit(stop(msg)) lst = strsplit(msg, " at ")[[1]] pts = scan(text = lst[[length(lst)]], quiet = TRUE) if (length(pts) == 2 && is.numeric(pts)) assign(".geos_error", st_point(pts), envir = .sf_cache) })("IllegalArgumentException: Invalid number of points in LinearRing found 2 - must be 0 or >= 3")`: IllegalArgumentException: Invalid number of points in LinearRing found 2 - must be 0 or >= 3 Backtrace: ▆ 1. ├─mapme.biodiversity:::.read_raster(x, footprints) at test-calc_indicator.R:241:3 2. │ └─mapme.biodiversity:::.get_intersection(x, tindex) 3. │ ├─base::suppressMessages(targets <- st_intersects(x, tindex, sparse = FALSE)) 4. │ │ └─base::withCallingHandlers(...) 5. │ ├─sf::st_intersects(x, tindex, sparse = FALSE) 6. │ └─sf:::st_intersects.sfc(x, tindex, sparse = FALSE) 7. │ └─sf:::st_geos_binop(...) 8. │ └─sf:::CPL_geos_binop(...) 9. └─sf (local) ``("IllegalArgumentException: Invalid number of points in LinearRing found 2 - must be 0 or >= 3") ── Error ('test-calc_key_biodiversity_areas.R:14:3'): calc_key_biodiversity_areas works ── Error in `purrr::map(resources, function(resource) { resource <- avail_resources[[resource]] resource_type <- unique(resource[["type"]]) reader <- switch(resource_type, raster = .read_raster, vector = .read_vector, stop(sprintf("Resource type '%s' currently not supported", resource_type))) reader(x, resource, mode) })`: i In index: 1. Caused by error in `scan()`: ! scan() expected 'a real', got 'IllegalArgumentException:' Backtrace: ▆ 1. ├─mapme.biodiversity::prep_resources(x) at test-calc_key_biodiversity_areas.R:14:3 2. │ └─purrr::map(...) 3. │ └─purrr:::map_("list", .x, .f, ..., .progress = .progress) 4. │ ├─purrr:::with_indexed_errors(...) 5. │ │ └─base::withCallingHandlers(...) 6. │ ├─purrr:::call_with_cleanup(...) 7. │ └─mapme.biodiversity (local) .f(.x[[i]], ...) 8. │ └─mapme.biodiversity (local) reader(x, resource, mode) 9. │ └─mapme.biodiversity:::.get_intersection(x, tindex) 10. │ ├─base::suppressMessages(targets <- st_intersects(x, tindex, sparse = FALSE)) 11. │ │ └─base::withCallingHandlers(...) 12. │ ├─sf::st_intersects(x, tindex, sparse = FALSE) 13. │ └─sf:::st_intersects.sf(x, tindex, sparse = FALSE) 14. │ └─sf:::st_geos_binop(...) 15. │ └─sf:::CPL_geos_binop(...) 16. ├─sf (local) ``("IllegalArgumentException: Invalid number of points in LinearRing found 2 - must be 0 or >= 3") 17. │ └─base::scan(text = lst[[length(lst)]], quiet = TRUE) 18. └─base::.handleSimpleError(...) 19. └─purrr (local) h(simpleError(msg, call)) 20. └─cli::cli_abort(...) 21. └─rlang::abort(...) ── Error ('test-calc_key_biodiversity_areas.R:14:3'): calc_key_biodiversity_areas works ── Error in `purrr::map(resources, function(resource) { resource <- avail_resources[[resource]] resource_type <- unique(resource[["type"]]) reader <- switch(resource_type, raster = .read_raster, vector = .read_vector, stop(sprintf("Resource type '%s' currently not supported", resource_type))) reader(x, resource, mode) })`: i In index: 1. Caused by error: ! IllegalArgumentException: Invalid number of points in LinearRing found 2 - must be 0 or >= 3 Backtrace: ▆ 1. ├─mapme.biodiversity::prep_resources(x) at test-calc_key_biodiversity_areas.R:14:3 2. │ └─purrr::map(...) 3. │ └─purrr:::map_("list", .x, .f, ..., .progress = .progress) 4. │ ├─purrr:::with_indexed_errors(...) 5. │ │ └─base::withCallingHandlers(...) 6. │ ├─purrr:::call_with_cleanup(...) 7. │ └─mapme.biodiversity (local) .f(.x[[i]], ...) 8. │ └─mapme.biodiversity (local) reader(x, resource, mode) 9. │ └─mapme.biodiversity:::.get_intersection(x, tindex) 10. │ ├─base::suppressMessages(targets <- st_intersects(x, tindex, sparse = FALSE)) 11. │ │ └─base::withCallingHandlers(...) 12. │ ├─sf::st_intersects(x, tindex, sparse = FALSE) 13. │ └─sf:::st_intersects.sf(x, tindex, sparse = FALSE) 14. │ └─sf:::st_geos_binop(...) 15. │ └─sf:::CPL_geos_binop(...) 16. ├─sf (local) ``("IllegalArgumentException: Invalid number of points in LinearRing found 2 - must be 0 or >= 3") 17. │ └─base::stop(msg) 18. └─base::.handleSimpleError(...) 19. └─purrr (local) h(simpleError(msg, call)) 20. └─cli::cli_abort(...) 21. └─rlang::abort(...) ── Error ('test-calc_precipitation_wc.R:13:3'): worldclim precipitation works ── Error in `purrr::map(resources, function(resource) { resource <- avail_resources[[resource]] resource_type <- unique(resource[["type"]]) reader <- switch(resource_type, raster = .read_raster, vector = .read_vector, stop(sprintf("Resource type '%s' currently not supported", resource_type))) reader(x, resource, mode) })`: i In index: 1. Caused by error in `scan()`: ! scan() expected 'a real', got 'IllegalArgumentException:' Backtrace: ▆ 1. ├─mapme.biodiversity::prep_resources(x) at test-calc_precipitation_wc.R:13:3 2. │ └─purrr::map(...) 3. │ └─purrr:::map_("list", .x, .f, ..., .progress = .progress) 4. │ ├─purrr:::with_indexed_errors(...) 5. │ │ └─base::withCallingHandlers(...) 6. │ ├─purrr:::call_with_cleanup(...) 7. │ └─mapme.biodiversity (local) .f(.x[[i]], ...) 8. │ └─mapme.biodiversity (local) reader(x, resource, mode) 9. │ └─mapme.biodiversity:::.get_intersection(x, tindex) 10. │ ├─base::suppressMessages(targets <- st_intersects(x, tindex, sparse = FALSE)) 11. │ │ └─base::withCallingHandlers(...) 12. │ ├─sf::st_intersects(x, tindex, sparse = FALSE) 13. │ └─sf:::st_intersects.sfc(x, tindex, sparse = FALSE) 14. │ └─sf:::st_geos_binop(...) 15. │ └─sf:::CPL_geos_binop(...) 16. ├─sf (local) ``("IllegalArgumentException: Invalid number of points in LinearRing found 2 - must be 0 or >= 3") 17. │ └─base::scan(text = lst[[length(lst)]], quiet = TRUE) 18. └─base::.handleSimpleError(...) 19. └─purrr (local) h(simpleError(msg, call)) 20. └─cli::cli_abort(...) 21. └─rlang::abort(...) ── Error ('test-calc_precipitation_wc.R:13:3'): worldclim precipitation works ── Error in `purrr::map(resources, function(resource) { resource <- avail_resources[[resource]] resource_type <- unique(resource[["type"]]) reader <- switch(resource_type, raster = .read_raster, vector = .read_vector, stop(sprintf("Resource type '%s' currently not supported", resource_type))) reader(x, resource, mode) })`: i In index: 1. Caused by error: ! IllegalArgumentException: Invalid number of points in LinearRing found 2 - must be 0 or >= 3 Backtrace: ▆ 1. ├─mapme.biodiversity::prep_resources(x) at test-calc_precipitation_wc.R:13:3 2. │ └─purrr::map(...) 3. │ └─purrr:::map_("list", .x, .f, ..., .progress = .progress) 4. │ ├─purrr:::with_indexed_errors(...) 5. │ │ └─base::withCallingHandlers(...) 6. │ ├─purrr:::call_with_cleanup(...) 7. │ └─mapme.biodiversity (local) .f(.x[[i]], ...) 8. │ └─mapme.biodiversity (local) reader(x, resource, mode) 9. │ └─mapme.biodiversity:::.get_intersection(x, tindex) 10. │ ├─base::suppressMessages(targets <- st_intersects(x, tindex, sparse = FALSE)) 11. │ │ └─base::withCallingHandlers(...) 12. │ ├─sf::st_intersects(x, tindex, sparse = FALSE) 13. │ └─sf:::st_intersects.sfc(x, tindex, sparse = FALSE) 14. │ └─sf:::st_geos_binop(...) 15. │ └─sf:::CPL_geos_binop(...) 16. ├─sf (local) ``("IllegalArgumentException: Invalid number of points in LinearRing found 2 - must be 0 or >= 3") 17. │ └─base::stop(msg) 18. └─base::.handleSimpleError(...) 19. └─purrr (local) h(simpleError(msg, call)) 20. └─cli::cli_abort(...) 21. └─rlang::abort(...) ── Error ('test-calc_temperature_max_wc.R:13:3'): worldclim maximum temperature works ── Error in `purrr::map(resources, function(resource) { resource <- avail_resources[[resource]] resource_type <- unique(resource[["type"]]) reader <- switch(resource_type, raster = .read_raster, vector = .read_vector, stop(sprintf("Resource type '%s' currently not supported", resource_type))) reader(x, resource, mode) })`: i In index: 1. Caused by error in `scan()`: ! scan() expected 'a real', got 'IllegalArgumentException:' Backtrace: ▆ 1. ├─mapme.biodiversity::prep_resources(x) at test-calc_temperature_max_wc.R:13:3 2. │ └─purrr::map(...) 3. │ └─purrr:::map_("list", .x, .f, ..., .progress = .progress) 4. │ ├─purrr:::with_indexed_errors(...) 5. │ │ └─base::withCallingHandlers(...) 6. │ ├─purrr:::call_with_cleanup(...) 7. │ └─mapme.biodiversity (local) .f(.x[[i]], ...) 8. │ └─mapme.biodiversity (local) reader(x, resource, mode) 9. │ └─mapme.biodiversity:::.get_intersection(x, tindex) 10. │ ├─base::suppressMessages(targets <- st_intersects(x, tindex, sparse = FALSE)) 11. │ │ └─base::withCallingHandlers(...) 12. │ ├─sf::st_intersects(x, tindex, sparse = FALSE) 13. │ └─sf:::st_intersects.sfc(x, tindex, sparse = FALSE) 14. │ └─sf:::st_geos_binop(...) 15. │ └─sf:::CPL_geos_binop(...) 16. ├─sf (local) ``("IllegalArgumentException: Invalid number of points in LinearRing found 2 - must be 0 or >= 3") 17. │ └─base::scan(text = lst[[length(lst)]], quiet = TRUE) 18. └─base::.handleSimpleError(...) 19. └─purrr (local) h(simpleError(msg, call)) 20. └─cli::cli_abort(...) 21. └─rlang::abort(...) ── Error ('test-calc_temperature_max_wc.R:13:3'): worldclim maximum temperature works ── Error in `purrr::map(resources, function(resource) { resource <- avail_resources[[resource]] resource_type <- unique(resource[["type"]]) reader <- switch(resource_type, raster = .read_raster, vector = .read_vector, stop(sprintf("Resource type '%s' currently not supported", resource_type))) reader(x, resource, mode) })`: i In index: 1. Caused by error: ! IllegalArgumentException: Invalid number of points in LinearRing found 2 - must be 0 or >= 3 Backtrace: ▆ 1. ├─mapme.biodiversity::prep_resources(x) at test-calc_temperature_max_wc.R:13:3 2. │ └─purrr::map(...) 3. │ └─purrr:::map_("list", .x, .f, ..., .progress = .progress) 4. │ ├─purrr:::with_indexed_errors(...) 5. │ │ └─base::withCallingHandlers(...) 6. │ ├─purrr:::call_with_cleanup(...) 7. │ └─mapme.biodiversity (local) .f(.x[[i]], ...) 8. │ └─mapme.biodiversity (local) reader(x, resource, mode) 9. │ └─mapme.biodiversity:::.get_intersection(x, tindex) 10. │ ├─base::suppressMessages(targets <- st_intersects(x, tindex, sparse = FALSE)) 11. │ │ └─base::withCallingHandlers(...) 12. │ ├─sf::st_intersects(x, tindex, sparse = FALSE) 13. │ └─sf:::st_intersects.sfc(x, tindex, sparse = FALSE) 14. │ └─sf:::st_geos_binop(...) 15. │ └─sf:::CPL_geos_binop(...) 16. ├─sf (local) ``("IllegalArgumentException: Invalid number of points in LinearRing found 2 - must be 0 or >= 3") 17. │ └─base::stop(msg) 18. └─base::.handleSimpleError(...) 19. └─purrr (local) h(simpleError(msg, call)) 20. └─cli::cli_abort(...) 21. └─rlang::abort(...) ── Error ('test-calc_temperature_min_wc.R:13:3'): worldclim minimum temperature works ── Error in `purrr::map(resources, function(resource) { resource <- avail_resources[[resource]] resource_type <- unique(resource[["type"]]) reader <- switch(resource_type, raster = .read_raster, vector = .read_vector, stop(sprintf("Resource type '%s' currently not supported", resource_type))) reader(x, resource, mode) })`: i In index: 1. Caused by error in `scan()`: ! scan() expected 'a real', got 'IllegalArgumentException:' Backtrace: ▆ 1. ├─mapme.biodiversity::prep_resources(x) at test-calc_temperature_min_wc.R:13:3 2. │ └─purrr::map(...) 3. │ └─purrr:::map_("list", .x, .f, ..., .progress = .progress) 4. │ ├─purrr:::with_indexed_errors(...) 5. │ │ └─base::withCallingHandlers(...) 6. │ ├─purrr:::call_with_cleanup(...) 7. │ └─mapme.biodiversity (local) .f(.x[[i]], ...) 8. │ └─mapme.biodiversity (local) reader(x, resource, mode) 9. │ └─mapme.biodiversity:::.get_intersection(x, tindex) 10. │ ├─base::suppressMessages(targets <- st_intersects(x, tindex, sparse = FALSE)) 11. │ │ └─base::withCallingHandlers(...) 12. │ ├─sf::st_intersects(x, tindex, sparse = FALSE) 13. │ └─sf:::st_intersects.sfc(x, tindex, sparse = FALSE) 14. │ └─sf:::st_geos_binop(...) 15. │ └─sf:::CPL_geos_binop(...) 16. ├─sf (local) ``("IllegalArgumentException: Invalid number of points in LinearRing found 2 - must be 0 or >= 3") 17. │ └─base::scan(text = lst[[length(lst)]], quiet = TRUE) 18. └─base::.handleSimpleError(...) 19. └─purrr (local) h(simpleError(msg, call)) 20. └─cli::cli_abort(...) 21. └─rlang::abort(...) ── Error ('test-calc_temperature_min_wc.R:13:3'): worldclim minimum temperature works ── Error in `purrr::map(resources, function(resource) { resource <- avail_resources[[resource]] resource_type <- unique(resource[["type"]]) reader <- switch(resource_type, raster = .read_raster, vector = .read_vector, stop(sprintf("Resource type '%s' currently not supported", resource_type))) reader(x, resource, mode) })`: i In index: 1. Caused by error: ! IllegalArgumentException: Invalid number of points in LinearRing found 2 - must be 0 or >= 3 Backtrace: ▆ 1. ├─mapme.biodiversity::prep_resources(x) at test-calc_temperature_min_wc.R:13:3 2. │ └─purrr::map(...) 3. │ └─purrr:::map_("list", .x, .f, ..., .progress = .progress) 4. │ ├─purrr:::with_indexed_errors(...) 5. │ │ └─base::withCallingHandlers(...) 6. │ ├─purrr:::call_with_cleanup(...) 7. │ └─mapme.biodiversity (local) .f(.x[[i]], ...) 8. │ └─mapme.biodiversity (local) reader(x, resource, mode) 9. │ └─mapme.biodiversity:::.get_intersection(x, tindex) 10. │ ├─base::suppressMessages(targets <- st_intersects(x, tindex, sparse = FALSE)) 11. │ │ └─base::withCallingHandlers(...) 12. │ ├─sf::st_intersects(x, tindex, sparse = FALSE) 13. │ └─sf:::st_intersects.sfc(x, tindex, sparse = FALSE) 14. │ └─sf:::st_geos_binop(...) 15. │ └─sf:::CPL_geos_binop(...) 16. ├─sf (local) ``("IllegalArgumentException: Invalid number of points in LinearRing found 2 - must be 0 or >= 3") 17. │ └─base::stop(msg) 18. └─base::.handleSimpleError(...) 19. └─purrr (local) h(simpleError(msg, call)) 20. └─cli::cli_abort(...) 21. └─rlang::abort(...) ── Error ('test-calc_traveltime_2000.R:12:3'): traveltime_2000 works ─────────── Error in `purrr::map(resources, function(resource) { resource <- avail_resources[[resource]] resource_type <- unique(resource[["type"]]) reader <- switch(resource_type, raster = .read_raster, vector = .read_vector, stop(sprintf("Resource type '%s' currently not supported", resource_type))) reader(x, resource, mode) })`: i In index: 1. Caused by error in `scan()`: ! scan() expected 'a real', got 'IllegalArgumentException:' Backtrace: ▆ 1. ├─mapme.biodiversity::prep_resources(x) at test-calc_traveltime_2000.R:12:3 2. │ └─purrr::map(...) 3. │ └─purrr:::map_("list", .x, .f, ..., .progress = .progress) 4. │ ├─purrr:::with_indexed_errors(...) 5. │ │ └─base::withCallingHandlers(...) 6. │ ├─purrr:::call_with_cleanup(...) 7. │ └─mapme.biodiversity (local) .f(.x[[i]], ...) 8. │ └─mapme.biodiversity (local) reader(x, resource, mode) 9. │ └─mapme.biodiversity:::.get_intersection(x, tindex) 10. │ ├─base::suppressMessages(targets <- st_intersects(x, tindex, sparse = FALSE)) 11. │ │ └─base::withCallingHandlers(...) 12. │ ├─sf::st_intersects(x, tindex, sparse = FALSE) 13. │ └─sf:::st_intersects.sfc(x, tindex, sparse = FALSE) 14. │ └─sf:::st_geos_binop(...) 15. │ └─sf:::CPL_geos_binop(...) 16. ├─sf (local) ``("IllegalArgumentException: Invalid number of points in LinearRing found 2 - must be 0 or >= 3") 17. │ └─base::scan(text = lst[[length(lst)]], quiet = TRUE) 18. └─base::.handleSimpleError(...) 19. └─purrr (local) h(simpleError(msg, call)) 20. └─cli::cli_abort(...) 21. └─rlang::abort(...) ── Error ('test-calc_traveltime_2000.R:12:3'): traveltime_2000 works ─────────── Error in `purrr::map(resources, function(resource) { resource <- avail_resources[[resource]] resource_type <- unique(resource[["type"]]) reader <- switch(resource_type, raster = .read_raster, vector = .read_vector, stop(sprintf("Resource type '%s' currently not supported", resource_type))) reader(x, resource, mode) })`: i In index: 1. Caused by error: ! IllegalArgumentException: Invalid number of points in LinearRing found 2 - must be 0 or >= 3 Backtrace: ▆ 1. ├─mapme.biodiversity::prep_resources(x) at test-calc_traveltime_2000.R:12:3 2. │ └─purrr::map(...) 3. │ └─purrr:::map_("list", .x, .f, ..., .progress = .progress) 4. │ ├─purrr:::with_indexed_errors(...) 5. │ │ └─base::withCallingHandlers(...) 6. │ ├─purrr:::call_with_cleanup(...) 7. │ └─mapme.biodiversity (local) .f(.x[[i]], ...) 8. │ └─mapme.biodiversity (local) reader(x, resource, mode) 9. │ └─mapme.biodiversity:::.get_intersection(x, tindex) 10. │ ├─base::suppressMessages(targets <- st_intersects(x, tindex, sparse = FALSE)) 11. │ │ └─base::withCallingHandlers(...) 12. │ ├─sf::st_intersects(x, tindex, sparse = FALSE) 13. │ └─sf:::st_intersects.sfc(x, tindex, sparse = FALSE) 14. │ └─sf:::st_geos_binop(...) 15. │ └─sf:::CPL_geos_binop(...) 16. ├─sf (local) ``("IllegalArgumentException: Invalid number of points in LinearRing found 2 - must be 0 or >= 3") 17. │ └─base::stop(msg) 18. └─base::.handleSimpleError(...) 19. └─purrr (local) h(simpleError(msg, call)) 20. └─cli::cli_abort(...) 21. └─rlang::abort(...) ── Error ('test-get_key_biodiversity_areas.R:26:3'): get_key_biodiversity_areas works ── Error in `purrr::map(resources, function(resource) { resource <- avail_resources[[resource]] resource_type <- unique(resource[["type"]]) reader <- switch(resource_type, raster = .read_raster, vector = .read_vector, stop(sprintf("Resource type '%s' currently not supported", resource_type))) reader(x, resource, mode) })`: i In index: 1. Caused by error in `scan()`: ! scan() expected 'a real', got 'IllegalArgumentException:' Backtrace: ▆ 1. ├─testthat::expect_equal(names(prep_resources(res)), "key_biodiversity_areas") at test-get_key_biodiversity_areas.R:26:3 2. │ └─testthat::quasi_label(enquo(object), label, arg = "object") 3. │ └─rlang::eval_bare(expr, quo_get_env(quo)) 4. ├─mapme.biodiversity::prep_resources(res) 5. │ └─purrr::map(...) 6. │ └─purrr:::map_("list", .x, .f, ..., .progress = .progress) 7. │ ├─purrr:::with_indexed_errors(...) 8. │ │ └─base::withCallingHandlers(...) 9. │ ├─purrr:::call_with_cleanup(...) 10. │ └─mapme.biodiversity (local) .f(.x[[i]], ...) 11. │ └─mapme.biodiversity (local) reader(x, resource, mode) 12. │ └─mapme.biodiversity:::.get_intersection(x, tindex) 13. │ ├─base::suppressMessages(targets <- st_intersects(x, tindex, sparse = FALSE)) 14. │ │ └─base::withCallingHandlers(...) 15. │ ├─sf::st_intersects(x, tindex, sparse = FALSE) 16. │ └─sf:::st_intersects.sf(x, tindex, sparse = FALSE) 17. │ └─sf:::st_geos_binop(...) 18. │ └─sf:::CPL_geos_binop(...) 19. ├─sf (local) ``("IllegalArgumentException: Invalid number of points in LinearRing found 2 - must be 0 or >= 3") 20. │ └─base::scan(text = lst[[length(lst)]], quiet = TRUE) 21. └─base::.handleSimpleError(...) 22. └─purrr (local) h(simpleError(msg, call)) 23. └─cli::cli_abort(...) 24. └─rlang::abort(...) ── Error ('test-get_key_biodiversity_areas.R:26:3'): get_key_biodiversity_areas works ── Error in `purrr::map(resources, function(resource) { resource <- avail_resources[[resource]] resource_type <- unique(resource[["type"]]) reader <- switch(resource_type, raster = .read_raster, vector = .read_vector, stop(sprintf("Resource type '%s' currently not supported", resource_type))) reader(x, resource, mode) })`: i In index: 1. Caused by error: ! IllegalArgumentException: Invalid number of points in LinearRing found 2 - must be 0 or >= 3 Backtrace: ▆ 1. ├─testthat::expect_equal(names(prep_resources(res)), "key_biodiversity_areas") at test-get_key_biodiversity_areas.R:26:3 2. │ └─testthat::quasi_label(enquo(object), label, arg = "object") 3. │ └─rlang::eval_bare(expr, quo_get_env(quo)) 4. ├─mapme.biodiversity::prep_resources(res) 5. │ └─purrr::map(...) 6. │ └─purrr:::map_("list", .x, .f, ..., .progress = .progress) 7. │ ├─purrr:::with_indexed_errors(...) 8. │ │ └─base::withCallingHandlers(...) 9. │ ├─purrr:::call_with_cleanup(...) 10. │ └─mapme.biodiversity (local) .f(.x[[i]], ...) 11. │ └─mapme.biodiversity (local) reader(x, resource, mode) 12. │ └─mapme.biodiversity:::.get_intersection(x, tindex) 13. │ ├─base::suppressMessages(targets <- st_intersects(x, tindex, sparse = FALSE)) 14. │ │ └─base::withCallingHandlers(...) 15. │ ├─sf::st_intersects(x, tindex, sparse = FALSE) 16. │ └─sf:::st_intersects.sf(x, tindex, sparse = FALSE) 17. │ └─sf:::st_geos_binop(...) 18. │ └─sf:::CPL_geos_binop(...) 19. ├─sf (local) ``("IllegalArgumentException: Invalid number of points in LinearRing found 2 - must be 0 or >= 3") 20. │ └─base::stop(msg) 21. └─base::.handleSimpleError(...) 22. └─purrr (local) h(simpleError(msg, call)) 23. └─cli::cli_abort(...) 24. └─rlang::abort(...) [ FAIL 16 | WARN 0 | SKIP 34 | PASS 458 ] Error: Test failures Execution halted Package: wk Check: tests New result: ERROR Running ‘testthat.R’ [14s/14s] Running the tests in ‘tests/testthat.R’ failed. Complete output: > library(testthat) > library(wk) > > test_check("wk") [ FAIL 2 | WARN 0 | SKIP 0 | PASS 1679 ] ══ Failed tests ════════════════════════════════════════════════════════════════ ── Failure ('test-pkg-sf.R:154:3'): conversion to sf works ───────────────────── sf::st_as_sfc(rct(1, 2, 3, 4, crs = 4326)) (`actual`) not equal to sf::st_as_sfc(...) (`expected`). `attr(actual, 'oriented')` is absent `attr(expected, 'oriented')` is a logical vector (TRUE) ── Failure ('test-pkg-sf.R:159:3'): conversion to sf works ───────────────────── sf::st_as_sf(rct(1, 2, 3, 4, crs = 4326)) (`actual`) not equal to sf::st_as_sf(...) (`expected`). `attr(actual$geometry, 'oriented')` is absent `attr(expected$geometry, 'oriented')` is a logical vector (TRUE) [ FAIL 2 | WARN 0 | SKIP 0 | PASS 1679 ] Error: Test failures Execution halted