CRAN Package Check Results for Maintainer ‘Alex M Chubaty <achubaty at for-cast.ca>’

Last updated on 2025-12-28 05:50:15 CET.

Package ERROR NOTE OK
fpCompare 13
grainscape 13
SpaDES 13
SpaDES.tools 2 2 9

Package fpCompare

Current CRAN status: OK: 13

Package grainscape

Current CRAN status: OK: 13

Package SpaDES

Current CRAN status: OK: 13

Package SpaDES.tools

Current CRAN status: ERROR: 2, NOTE: 2, OK: 9

Version: 2.0.9
Check: examples
Result: ERROR Running examples in 'SpaDES.tools-Ex.R' failed The error most likely occurred in: > ### Name: spread2 > ### Title: Simulate a contagious spread process on a landscape, with > ### 'data.table' internals > ### Aliases: spread2 > > ### ** Examples > > library(terra) terra 1.8.86 Attaching package: 'terra' The following object is masked from 'package:SpaDES.tools': wrap > > origDTThreads <- data.table::setDTthreads(2L) > origNcpus <- options(Ncpus = 2L) > > a <- rast(ext(0, 10, 0, 10), res = 1) > sams <- sort(sample(ncell(a), 3)) > > # Simple use -- similar to spread(...) > out <- spread2(a, start = sams, 0.225) > if (interactive()) { + terra::plot(out) + } > > # Use maxSize -- this gives an upper limit > maxSizes <- sort(sample(1:10, size = length(sams))) > out <- spread2(a, start = sams, 0.225, maxSize = maxSizes, asRaster = FALSE) > # check TRUE using data.table .N > out[, .N, by = "initialPixels"]$N <= maxSizes [1] TRUE TRUE TRUE > > # Use exactSize -- gives an exact size, if there is enough space on the Raster > exactSizes <- maxSizes > out <- spread2(a, start = sams, spreadProb = 0.225, + exactSize = exactSizes, asRaster = FALSE) > out[, .N, by = "initialPixels"]$N == maxSizes # should be TRUE TRUE TRUE [1] TRUE TRUE TRUE > > # Use exactSize -- but where it can't be achieved > exactSizes <- sort(sample(100:110, size = length(sams))) > out <- spread2(a, start = sams, 1, exactSize = exactSizes) > > # Iterative calling -- create a function with a high escape probability > spreadWithEscape <- function(ras, start, escapeProb, spreadProb) { + out <- spread2(ras, start = sams, spreadProb = escapeProb, asRaster = FALSE) + while (any(out$state == "sourceActive")) { + # pass in previous output as start + out <- spread2(ras, start = out, spreadProb = spreadProb, + asRaster = FALSE, skipChecks = TRUE) # skipChecks for speed + } + out + } > > set.seed(421) > out1 <- spreadWithEscape(a, sams, escapeProb = 0.25, spreadProb = 0.225) > set.seed(421) > out2 <- spread2(a, sams, 0.225, asRaster = FALSE) > # The one with high escape probability is larger (most of the time) > NROW(out1) > NROW(out2) ## TODO: not true [1] FALSE > > ## Use neighProbs, with a spreadProb that is a RasterLayer > # Create a raster of different values, which will be the relative probabilities > # i.e., they are rescaled to relative probabilities within the 8 neighbour choices. > # The neighProbs below means 70% of the time, 1 neighbour will be chosen, > # 30% of the time 2 neighbours. > # The cells with spreadProb of 5 are 5 times more likely than cells with 1 to be chosen, > # when they are both within the 8 neighbours > sp <- rast(ext(0, 3, 0, 3), res = 1, vals = 1:9) #small raster, simple values > # Check neighProbs worked > out <- list() > > # enough replicates to see stabilized probabilities > for (i in 1:100) { + out[[i]] <- spread2(sp, spreadProbRel = sp, spreadProb = 1, + start = 5, iterations = 1, + neighProbs = c(1), asRaster = FALSE) + } > out <- data.table::rbindlist(out)[pixels != 5] # remove starting cell > table(sp[out$pixels]) lyr.1 1 2 3 4 6 7 8 9 3 5 8 8 17 13 26 20 > # should be non-significant -- note no 5 because that was the starting cell > # This tests whether the null model is true ... there should be proportions > # equivalent to 1:2:3:4:6:7:8:9 ... i.e,. cell 9 should have 9x as many events > # spread to it as cell 1. This comes from sp object above which is providing > # the relative spread probabilities > keep <- c(1:4, 6:9) > chisq.test(keep, unname(tabulate(sp[out$pixels]$lyr.1, 9)[keep]), + simulate.p.value = TRUE) Pearson's Chi-squared test with simulated p-value (based on 2000 replicates) data: keep and unname(tabulate(sp[out$pixels]$lyr.1, 9)[keep]) X-squared = 48, df = NA, p-value = 1 > > ## Example showing asymmetry > sams <- ncell(a) / 4 - ncol(a) / 4 * 3 > circs <- spread2(a, spreadProb = 0.213, start = sams, + asymmetry = 2, asymmetryAngle = 135, + asRaster = TRUE) Error in `[.data.table`(dd, , `:=`(quantityAdj2, quantityAdj/(mean(quantityAdj)/mean(quantity))), : attempt access index 7/7 in VECTOR_ELT Calls: spread2 -> asymmetryAdjust -> [ -> [.data.table Execution halted Flavor: r-devel-windows-x86_64

Version: 2.0.9
Check: tests
Result: ERROR Running 'testthat.R' [125s] 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") Attaching package: 'data.table' The following object is masked from 'package:base': %notin% Assuming matrix is in latitude/longitude The CRS provided is not in meters; converting internally to UTM so area will be approximately correct. Ran 10/10 deferred expressions Ran 8/8 deferred expressions Ran 6/6 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 [ FAIL 5 | WARN 0 | SKIP 4 | PASS 1802 ] ══ 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-spread.R:659:7'): spread stopRule does not work correctly ────── Error in ``[.data.table`(circs, , `:=`(numEvents, sum(unique(id))), by = indices)`: attempt access index 4/4 in VECTOR_ELT Backtrace: ▆ 1. ├─circs[, `:=`(numEvents, sum(unique(id))), by = indices] at test-spread.R:659:7 2. └─data.table:::`[.data.table`(...) at test-spread.R:659:7 ── Error ('test-spread2.R:135:5'): spread2 tests ─────────────────────────────── Error in ``[.data.table`(dt, , `:=`(dups = duplicatedInt(pixels)), by = "initialPixels")`: attempt access index 4/4 in VECTOR_ELT Backtrace: ▆ 1. └─SpaDES.tools::spread2(...) at test-spread2.R:135:5 2. ├─dt[, `:=`(dups = duplicatedInt(pixels)), by = "initialPixels"] 3. └─data.table:::`[.data.table`(...) ── Error ('test-spread2.R:400:5'): spread2 tests -- asymmetry ────────────────── Error in ``[.data.table`(dd, , `:=`(quantityAdj2, quantityAdj/(mean(quantityAdj)/mean(quantity))), by = "id")`: attempt access index 7/7 in VECTOR_ELT Backtrace: ▆ 1. └─SpaDES.tools::spread2(...) at test-spread2.R:400:5 2. └─SpaDES.tools:::asymmetryAdjust(...) 3. ├─...[] 4. └─data.table:::`[.data.table`(...) ── Failure ('test-spread2.R:653:5'): spread2 tests ───────────────────────────── Expected `{ ... }` not to throw any errors. Actually got a <simpleError> with message: attempt access index 6/6 in VECTOR_ELT ── Error ('test-spread2.R:658:5'): spread2 tests ─────────────────────────────── Error in `eval(code, test_env)`: object 'out' not found Backtrace: ▆ 1. ├─testthat::expect_true("effectiveDistance" %in% colnames(out)) at test-spread2.R:658:5 2. │ └─testthat::quasi_label(enquo(object), label) 3. │ └─rlang::eval_bare(expr, quo_get_env(quo)) 4. ├─"effectiveDistance" %in% colnames(out) 5. └─base::colnames(out) 6. └─base::is.data.frame(x) [ FAIL 5 | WARN 0 | SKIP 4 | PASS 1802 ] Error: ! Test failures. Execution halted Flavor: r-devel-windows-x86_64

Version: 2.0.9
Check: package dependencies
Result: NOTE Package suggested but not available for checking: ‘NLMR’ Flavors: r-oldrel-macos-arm64, r-oldrel-macos-x86_64, r-oldrel-windows-x86_64

Version: 2.0.9
Check: examples
Result: 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 Flavor: r-oldrel-windows-x86_64

Version: 2.0.9
Check: tests
Result: ERROR Running 'testthat.R' [204s] 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 = `<chr>`) at test-spread2.R:472:5 2. ├─terra::`crs<-`(`*tmp*`, value = `<chr>`) 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(`<fn>`, "[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 Flavor: r-oldrel-windows-x86_64

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.