* using log directory 'd:/Rcompile/CRANpkg/local/4.4/SpaDES.tools.Rcheck' * using R version 4.4.3 (2025-02-28 ucrt) * using platform: x86_64-w64-mingw32 * R was compiled by gcc.exe (GCC) 13.3.0 GNU Fortran (GCC) 13.3.0 * running under: Windows Server 2022 x64 (build 20348) * using session charset: UTF-8 * checking for file 'SpaDES.tools/DESCRIPTION' ... OK * checking extension type ... Package * this is package 'SpaDES.tools' version '2.0.9' * package encoding: UTF-8 * checking package namespace information ... OK * checking package dependencies ... NOTE Package suggested but not available for checking: 'NLMR' * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking whether package 'SpaDES.tools' can be installed ... OK * used C++ compiler: 'g++.exe (GCC) 13.3.0' * checking installed package size ... OK * checking package directory ... OK * checking DESCRIPTION meta-information ... OK * checking top-level files ... OK * checking for left-over files ... OK * checking index information ... OK * checking package subdirectories ... OK * checking code files for non-ASCII characters ... OK * checking R files for syntax errors ... OK * checking whether the package can be loaded ... [9s] OK * checking whether the package can be loaded with stated dependencies ... [9s] OK * checking whether the package can be unloaded cleanly ... [8s] OK * checking whether the namespace can be loaded with stated dependencies ... [9s] OK * checking whether the namespace can be unloaded cleanly ... [9s] OK * checking loading without being on the library search path ... [9s] OK * checking whether startup messages can be suppressed ... [9s] OK * checking use of S3 registration ... OK * checking dependencies in R code ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... [31s] OK * checking Rd files ... [2s] OK * checking Rd metadata ... OK * checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK * checking line endings in C/C++/Fortran sources/headers ... OK * checking pragmas in C/C++ headers and code ... OK * checking compiled code ... OK * checking examples ... [18s] ERROR Running examples in 'SpaDES.tools-Ex.R' failed The error most likely occurred in: > ### Name: randomPolygons > ### Title: Produce a 'SpatRaster' of random polygons > ### Aliases: randomPolygons randomPolygon randomPolygon.default > > ### ** Examples > > origDTThreads <- data.table::setDTthreads(2L) > origNcpus <- options(Ncpus = 2L) > > set.seed(1234) > Ras <- randomPolygons(numTypes = 5) > if (interactive() ) { + terra::plot(Ras, col = c("yellow", "dark green", "blue", "dark red")) + } > > # more complex patterning, with a range of patch sizes > r <- terra::rast(terra::ext(0, 50, 0, 50), resolution = 1, vals = 0) > a <- randomPolygons(numTypes = 400, r) duplicate initial loci are provided > a[a < 320] <- 0 > a[a >= 320] <- 1 > clumped <- terra::patches(a) > if (interactive()) { + terra::plot(a) + } > > # clean up > data.table::setDTthreads(origDTThreads) > options(Ncpus = origNcpus) > > a1 <- terra::vect(cbind(-110, 59), crs = "epsg:4326") Warning: PROJ: proj_create_from_database: Cannot find proj.db (GDAL error 1) Warning: [crs<-] Cannot set SRS to vector: empty srs > a2 <- randomPolygon(a1, area = 1e7) Error: [project] input crs is not valid Execution halted * checking for unstated dependencies in 'tests' ... OK * checking tests ... [199s] ERROR Running 'testthat.R' [199s] 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 > > Sys.setenv("OMP_THREAD_LIMIT" = 2) > origDTthreads <- data.table::setDTthreads(2L) > > library(testthat) > library(SpaDES.tools) > > test_check("SpaDES.tools") Ran 28/28 deferred expressions Ran 10/10 deferred expressions Ran 7/7 deferred expressions Ran 6/6 deferred expressions Ran 8/8 deferred expressions duplicate initial loci are provided duplicate initial loci are provided 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Scales with number of starts, not maxSize of raster exactSize provided. It does not match with size attr(start, 'spreadState')$maxSize. Using the new exactSize provided. Perhaps sorted differently?Try sorting initial call to spread2 so that pixel number of start cells is strictly increasing 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Scales with number of starts, not maxSize of raster exactSize provided. It does not match with size attr(start, 'spreadState')$maxSize. Using the new exactSize provided. Perhaps sorted differently?Try sorting initial call to spread2 so that pixel number of start cells is strictly increasing [ FAIL 4 | WARN 13 | SKIP 4 | PASS 2204 ] ══ Skipped tests (4) ═══════════════════════════════════════════════════════════ • On CRAN (3): 'test-splitRaster.R:227:3', 'test-splitRaster.R:288:3', 'test-spread.R:1225:3' • {NLMR} is not installed (1): 'test-neutralLandscapeMap.R:2:3' ══ Failed tests ════════════════════════════════════════════════════════════════ ── Error ('test-randomPolygon.R:6:3'): randomPolygon: does not work properly ─── Error: [rast] empty srs Backtrace: ▆ 1. ├─terra::crs("epsg:4326") at test-randomPolygon.R:6:3 2. └─terra::crs("epsg:4326") 3. └─terra (local) .local(x, ...) 4. ├─terra::rast(crs = x) 5. └─terra::rast(crs = x) 6. └─terra (local) .local(x = x, ...) 7. └─terra:::new_rast(...) 8. └─terra:::messages(r, "rast") 9. └─terra:::error(f, x@pntr$getError()) ── Error ('test-spread.R:914:5'): rings and cir ──────────────────────────────── Error: [distance] CRS not defined Backtrace: ▆ 1. ├─terra::distance(hab, caribou) at test-spread.R:914:5 2. └─terra::distance(hab, caribou) 3. └─terra (local) .local(x, y, ...) 4. └─terra:::messages(x, "distance") 5. └─terra:::error(f, x@pntr$getError()) ── Error ('test-spread.R:966:3'): distanceFromPoints does not work correctly ─── Error: [distance] CRS not defined Backtrace: ▆ 1. ├─terra::distance(hab, coordsVect) at test-spread.R:966:3 2. └─terra::distance(hab, coordsVect) 3. └─terra (local) .local(x, y, ...) 4. └─terra:::messages(x, "distance") 5. └─terra:::error(f, x@pntr$getError()) ── Error ('test-spread2.R:472:5'): spread2 tests -- asymmetry ────────────────── Error in `h(simpleError(msg, call))`: error in evaluating the argument 'x' in selecting a method for function 'crs': [rast] empty srs Backtrace: ▆ 1. ├─terra::`crs<-`(`*tmp*`, value = ``) at test-spread2.R:472:5 2. ├─terra::`crs<-`(`*tmp*`, value = ``) 3. │ └─raster::`projection<-`(`*tmp*`, value = value) 4. │ └─raster:::.getCRS(value) 5. │ ├─terra::crs(terra::crs(x), proj = TRUE) 6. │ ├─terra::crs(x) 7. │ └─terra::crs(x) 8. │ └─terra (local) .local(x, ...) 9. │ ├─terra::rast(crs = x) 10. │ └─terra::rast(crs = x) 11. │ └─terra (local) .local(x = x, ...) 12. │ └─terra:::new_rast(...) 13. │ └─terra:::messages(r, "rast") 14. │ └─terra:::error(f, x@pntr$getError()) 15. │ └─base::stop("[", f, "] ", emsg, ..., call. = FALSE) 16. └─base::.handleSimpleError(``, "[rast] empty srs", base::quote(NULL)) 17. └─base (local) h(simpleError(msg, call)) [ FAIL 4 | WARN 13 | SKIP 4 | PASS 2204 ] Error: ! Test failures. Execution halted * checking PDF version of manual ... [28s] OK * checking HTML version of manual ... [10s] OK * DONE Status: 2 ERRORs, 1 NOTE