Running examples in ‘multimark-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: getdensityClosedSCR
> ### Title: Calculate population density estimates
> ### Aliases: getdensityClosedSCR
> 
> ### ** Examples
> 
> ## Don't show: 
> sim.data<-simdataClosedSCR()
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
multimark
 --- call from context --- 
plotSpatialData(tEnc.Mat, trapCoords = spatialInputs$trapCoords, 
    studyArea = spatialInputs$studyArea, centers = spatialInputs$centers, 
    trapLines = TRUE)
 --- call from argument --- 
if (class(mms) == "multimarkSCRsetup") {
    studyArea <- mms@spatialInputs$studyArea
    trapCoords <- mms@spatialInputs$trapCoords
    Enc.Mat <- mms@Enc.Mat
} else {
    Enc.Mat <- mms
}
 --- R stacktrace ---
where 1: plotSpatialData(tEnc.Mat, trapCoords = spatialInputs$trapCoords, 
    studyArea = spatialInputs$studyArea, centers = spatialInputs$centers, 
    trapLines = TRUE)
where 2: simdataClosedSCR()

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (mms = NULL, trapCoords, studyArea, centers = NULL, 
    trapLines = FALSE) 
{
    cur.par <- par(no.readonly = TRUE)
    if (!is.null(mms)) {
        if (class(mms) == "multimarkSCRsetup") {
            studyArea <- mms@spatialInputs$studyArea
            trapCoords <- mms@spatialInputs$trapCoords
            Enc.Mat <- mms@Enc.Mat
        }
        else {
            Enc.Mat <- mms
        }
    }
    checkSpatialInputs(trapCoords, studyArea, centers)
    sAgrid <- SpatialGrid(points2grid(SpatialPoints(studyArea[, 
        c("x", "y")])))
    e <- extent(sAgrid)
    cells.dim <- attributes(sAgrid)$grid@cells.dim
    r <- raster(e, nrow = cells.dim["y"], ncol = cells.dim["x"])
    x <- rasterize(coordinates(sAgrid), r, studyArea[, 3], fun = max)
    breakpoints <- c(0, 0.5, 1)
    colors <- c("white", "green", "green")
    sp::plot(x, breaks = breakpoints, col = colors, legend = FALSE)
    sp::plot(sAgrid, add = TRUE, col = gray(0.75))
    if (is.null(centers)) {
        tmp <- legend(x = "top", legend = c("traps                          ", 
            "available habitat"), pch = c(17, 15), col = c(1, 
            "green"), box.col = "white", bty = "o", bg = "white", 
            cex = 0.8)
    }
    else {
        M <- ifelse(!is.null(mms), nrow(Enc.Mat), length(centers))
        rainColors <- grDevices::rainbow(M)
        ntraps <- nrow(trapCoords)
        noccas <- ncol(trapCoords[, -c(1, 2), drop = FALSE])
        if (length(centers) != M) 
            stop("'centers' must be of length ", M)
        for (i in 1:M) {
            points(studyArea[centers[i], "x"], studyArea[centers[i], 
                "y"], pch = 20, col = rainColors[i])
            if (!is.null(mms) & trapLines) {
                for (k in 1:ntraps) {
                  for (j in 1:noccas) {
                    if (Enc.Mat[i, (k - 1) * noccas + j] > 0) {
                      wig1 <- rnorm(1, 0, 0.01)
                      wig2 <- rnorm(1, 0, 0.01)
                      points(studyArea[centers[i], "x"], studyArea[centers[i], 
                        "y"], pch = 20, col = rainColors[i])
                      lines(rbind(trapCoords[k, c("x", "y")] + 
                        c(wig1, wig2), studyArea[centers[i], 
                        c("x", "y")]), col = rainColors[i], lty = 2, 
                        lwd = 0.5)
                    }
                  }
                }
            }
        }
        tmp <- legend(x = "top", legend = c("traps                          ", 
            "available habitat", "activity centers"), pch = c(17, 
            15, 1), col = c(1, "green"), box.col = "white", bty = "o", 
            bg = "white", cex = 0.8)
    }
    points(trapCoords[, c("x", "y")], pch = 17)
    par(cur.par)
}
<bytecode: 0x55ac567f5c60>
<environment: namespace:multimark>
 --- function search by body ---
Function plotSpatialData in namespace multimark has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1