CRAN Package Check Results for Package spatialEco

Last updated on 2020-01-20 01:50:36 CET.

Flavor Version Tinstall Tcheck Ttotal Status Flags
r-devel-linux-x86_64-debian-clang 1.2-1 11.70 92.35 104.05 ERROR
r-devel-linux-x86_64-debian-gcc 1.3-0 17.65 158.96 176.61 OK
r-devel-linux-x86_64-fedora-clang 1.3-0 226.61 NOTE
r-devel-linux-x86_64-fedora-gcc 1.3-0 277.91 NOTE
r-devel-windows-ix86+x86_64 1.2-1 46.00 170.00 216.00 OK
r-devel-windows-ix86+x86_64-gcc8 1.3-0 64.00 474.00 538.00 OK
r-patched-linux-x86_64 1.2-1 10.91 129.65 140.56 OK
r-patched-solaris-x86 1.3-0 339.40 NOTE
r-release-linux-x86_64 1.3-0 19.39 185.55 204.94 OK
r-release-windows-ix86+x86_64 1.3-0 53.00 404.00 457.00 OK
r-release-osx-x86_64 1.3-0 ERROR
r-oldrel-windows-ix86+x86_64 1.2-1 21.00 129.00 150.00 OK
r-oldrel-osx-x86_64 1.3-0 ERROR

Additional issues

rchk

Check Details

Version: 1.2-1
Check: examples
Result: ERROR
    Running examples in 'spatialEco-Ex.R' failed
    The error most likely occurred in:
    
    > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
    > ### Name: crossCorrelation
    > ### Title: Spatial cross correlation
    > ### Aliases: crossCorrelation
    >
    > ### ** Examples
    >
    > library(sp)
    > library(spdep)
    Loading required package: spData
    To access larger datasets in this package, install the spDataLarge
    package with: `install.packages('spDataLarge',
    repos='https://nowosad.github.io/drat/', type='source')`
    
    Attaching package: 'spData'
    
    The following object is masked from 'package:spatialEco':
    
     elev
    
    Loading required package: sf
    Linking to GEOS 3.8.0, GDAL 2.4.3, PROJ 6.3.0
    >
    > data(meuse)
    > coordinates(meuse) <- ~x+y
    >
    > #### Providing a neighbor contiguity spatial weights matrix
    > all.linked <- max(unlist(nbdists(knn2nb(knearneigh(coordinates(meuse))),
    + coordinates(meuse))))
    > nb <- nb2listw(dnearneigh(meuse, 0, all.linked), style = "B", zero.policy = TRUE)
    > Wij <- as.matrix( as(nb, "symmetricMatrix") )
    > ( I <- crossCorrelation(meuse$zinc, meuse$copper, w = Wij,
    + clust=TRUE, k=99) )
     ----------- FAILURE REPORT --------------
     --- failure: the condition has length > 1 ---
     --- srcref ---
    :
     --- package (from environment) ---
    spatialEco
     --- call from context ---
    crossCorrelation(meuse$zinc, meuse$copper, w = Wij, clust = TRUE,
     k = 99)
     --- call from argument ---
    if (!class(w) == "matrix") stop("Spatial weights must be in matrix form")
     --- R stacktrace ---
    where 1: crossCorrelation(meuse$zinc, meuse$copper, w = Wij, clust = TRUE,
     k = 99)
    
     --- value of length: 2 type: logical ---
    [1] FALSE TRUE
     --- function from context ---
    function (x, y = NULL, coords = NULL, w = NULL, type = c("LSCI",
     "GSCI"), k = 1000, dist.function = "inv.power", scale.xy = TRUE,
     scale.partial = FALSE, scale.matrix = FALSE, alpha = 0.05,
     clust = FALSE, return.sims = FALSE)
    {
     if (missing(x))
     stop("x must be specified")
     if (is.null(y))
     y = x
     if (length(y) != length(x))
     stop("[X,Y] are not equal")
     if (length(which(is.na(x))) != 0 | length(which(is.na(y))) !=
     0)
     stop("NA's not permitted in [X,Y]")
     if (k == 0)
     warning("Permutation is not being run, estimated p will be based on observed")
     if (scale.xy == FALSE)
     warning("It is assumed that x,v vectors are already scaled")
     type = type[1]
     n <- length(x)
     if (is.null(w)) {
     if (is.null(coords))
     stop("If no Wij matrix is provided, a coordinates matrix is required")
     w <- sp::spDists(coords)
     if (dist.function == "inv.power") {
     message("Calculating spatial weights matrix using inverse power function")
     w <- 1/w
     diag(w) <- 0
     w <- w/sum(w)
     }
     else if (dist.function == "neg.exponent") {
     message("Calculating spatial weights matrix using negative exponent")
     diag(w) <- NA
     mu <- mean(w, na.rm = TRUE)
     for (i in 1:nrow(w)) {
     for (j in 1:nrow(w)) {
     w[i, j] <- round(exp((-2 * w[i, j])/mu), 6)
     }
     }
     diag(w) <- 0
     }
     else {
     stop("Not a valid matrix option")
     }
     }
     else {
     if (!class(w) == "matrix")
     stop("Spatial weights must be in matrix form")
     if (ncol(w) != length(x) | nrow(w) != length(x))
     stop("Spatial weights matrix must be symmetrical and match x")
     w[which(is.na(w))] <- 0
     if (scale.matrix) {
     if (sum(w) > 0) {
     w <- as.matrix(w/sum(w))
     }
     }
     }
     if (scale.xy) {
     x <- (x - mean(x))/(stats::sd(x) * sqrt((length(x) -
     1)/length(x)))
     y <- (y - mean(y))/(stats::sd(y) * sqrt((length(y) -
     1)/length(y)))
     }
     SCI <- function(x, y, W, type.cc, scale.cc) {
     if (type.cc == "LSCI") {
     lsci.xy = as.numeric(x * y %*% W)
     lsci.yx = as.numeric(y * x %*% W)
     if (scale.cc) {
     lsci.xy <- (lsci.xy - min(lsci.xy)) * (1 - -1)/(max(lsci.xy) -
     min(lsci.xy)) + -1
     lsci.yx <- (lsci.yx - min(lsci.yx)) * (1 - -1)/(max(lsci.yx) -
     min(lsci.yx)) + -1
     }
     sci = data.frame(lsci.xy = lsci.xy, lsci.yx = lsci.yx)
     }
     if (type.cc == "GSCI") {
     gsci.xy = as.numeric(x * W %*% y)/(length(x) - 1)
     gsci.yx = as.numeric(y * W %*% x)/(length(x) - 1)
     if (scale.cc) {
     gsci.xy <- (gsci.xy - min(gsci.xy)) * (1 - -1)/(max(gsci.xy) -
     min(gsci.xy)) + -1
     gsci.yx <- (gsci.yx - min(gsci.yx)) * (1 - -1)/(max(gsci.yx) -
     min(gsci.yx)) + -1
     }
     sci = data.frame(gsci.xy = gsci.xy, gsci.yx = gsci.yx)
     }
     return(sci)
     }
     global.i <- as.numeric(x %*% w %*% y)/(length(x) - 1)
     if (type == "LSCI") {
     tstat = "lsci.xy"
     }
     else {
     tstat = "gsci.xy"
     }
     sci.results <- SCI(x = x, y = y, W = w, type.cc = type, scale.cc = scale.partial)
     if (clust) {
     lisa.clust <- as.character(interaction(x > 0, w %*% y >
     0))
     lisa.clust <- gsub("TRUE", "High", lisa.clust)
     lisa.clust <- gsub("FALSE", "Low", lisa.clust)
     }
     probs <- c(alpha/2, 1 - alpha/2)
     if (k > 0) {
     cat("\n ( Computing Permutation Distribution )\n")
     y.sim <- matrix(y[sample(1:n, size = n * k, replace = TRUE)],
     nrow = n, ncol = k)
     isim <- apply(y.sim, MARGIN = 2, function(j) t(x[sample(1:length(x))]) %*%
     w %*% j/(length(x) - 1))
     (global.p <- sum(abs(isim) > abs(global.i))/length(isim))
     y.sim <- matrix(y[sample(1:n, size = n * k, replace = TRUE)],
     nrow = n, ncol = k)
     isim <- apply(y.sim, MARGIN = 2, function(j) {
     SCI(as.numeric(t(x[sample(1:length(x))])), j, W = w,
     type.cc = type, scale.cc = scale.partial)[, tstat]
     })
     ttest.p <- round(apply(isim, 2, function(j) stats::t.test(sci.results[,
     tstat], y = j, alternative = "two.sided", paired = TRUE,
     conf.level = 1 - alpha)$p.value), 6)
     p <- length(ttest.p[ttest.p > alpha])/length(ttest.p)
     p1 <- 2 * min(length(ttest.p[ttest.p > alpha])/k, length(ttest.p[ttest.p <
     alpha])/k)
     results <- list(I = global.i, SCI = sci.results, nsim = k,
     global.p = global.p, local.p = p, range.p = p1)
     if (clust) {
     results$clusters <- lisa.clust
     }
     if (return.sims) {
     results$simulated.I <- isim
     }
     class(results) <- c("cross.cor", "list")
     }
     else {
     ttest.p <- round(stats::t.test(sci.results[, tstat],
     conf.level = 1 - alpha)$p.value, 6)
     ci <- stats::quantile(sci.results[, tstat], probs = probs)
     tstat <- sci.results[, tstat]
     p <- 2 * min(length(tstat[tstat >= ci[2]])/length(tstat),
     length(tstat[tstat <= ci[1]])/length(tstat))
     results <- list(I = global.i, SCI = sci.results, nsim = NULL,
     p = p, t.test = ttest.p)
     if (clust) {
     results$clusters <- lisa.clust
     }
     class(results) <- c("cross.cor", "list")
     }
     return(invisible(results))
    }
    <bytecode: 0x700f218>
    <environment: namespace:spatialEco>
     --- function search by body ---
    Function crossCorrelation in namespace spatialEco has this body.
     ----------- END OF FAILURE REPORT --------------
    Error in if (!class(w) == "matrix") stop("Spatial weights must be in matrix form") :
     the condition has length > 1
    Calls: crossCorrelation
    Execution halted
Flavor: r-devel-linux-x86_64-debian-clang

Version: 1.3-0
Check: dependencies in R code
Result: NOTE
    Namespaces in Imports field not imported from:
     ‘dplyr’ ‘fasterize’
     All declared Imports should be used.
Flavors: r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-patched-solaris-x86, r-release-osx-x86_64

Version: 1.3-0
Check: examples
Result: ERROR
    Running examples in ‘spatialEco-Ex.R’ failed
    The error most likely occurred in:
    
    > ### Name: hli
    > ### Title: Heat Load Index
    > ### Aliases: hli
    >
    > ### ** Examples
    >
    > library(raster)
    Loading required package: sp
    
    Attaching package: ‘raster’
    
    The following object is masked from ‘package:spatialEco’:
    
     shift
    
    > data(elev)
    > heat.load <- hli(elev)
    
     *** caught segfault ***
    address 0x119835ff8, cause 'memory not mapped'
    
    Traceback:
     1: .terrain(as.double(values(x)), as.integer(dim(out)), rs, un, nopt, lonlat, y)
     2: .local(x, ...)
     3: raster::terrain(x, opt = "slope", unit = "degrees")
     4: raster::terrain(x, opt = "slope", unit = "degrees")
     5: hli(elev)
    An irrecoverable exception occurred. R is aborting now ...
Flavor: r-release-osx-x86_64

Version: 1.3-0
Check: whether package can be installed
Result: ERROR
    Installation failed.
Flavor: r-oldrel-osx-x86_64