Running examples in 'spANOVA-Ex.R' failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: aovSar.crd
> ### Title: Using a SAR model to handle spatial dependence in a Completely
> ###   Randomized Design
> ### Aliases: aovSar.crd
> 
> ### ** Examples
> 
> data("crd_simulated")
> resp <- crd_simulated$y
> treat <- crd_simulated$trat
> coord <- cbind(crd_simulated$coordX, crd_simulated$coordY)
> cv <- aovSar.crd(resp, treat, coord)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
spANOVA
 --- call from context --- 
aovSar.crd(resp, treat, coord)
 --- call from argument --- 
if (!(is.matrix(coord) | class(coord) == "SpatialPoints")) {
    stop("'coord' must be a matrix or SpatialPoints object")
}
 --- R stacktrace ---
where 1: aovSar.crd(resp, treat, coord)

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (resp, treat, coord, seq.radius) 
{
    if (!(is.vector(resp) | is.numeric(resp))) {
        stop("'resp' must be a vector or numeric")
    }
    if (!(is.vector(treat) | is.numeric(treat))) {
        stop("'treat' must be a vector or numeric")
    }
    if (!(is.matrix(coord) | class(coord) == "SpatialPoints")) {
        stop("'coord' must be a matrix or SpatialPoints object")
    }
    if (ncol(coord) < 2) {
        stop("'coord' must have at least two columns")
    }
    if (missing(seq.radius)) {
        max.dist <- max(dist(coord))
        seq.radius <- seq(0, 0.5 * max.dist, l = 11)[-1]
    }
    params <- data.frame(radius = 0, rho = 0, AIC = 0)
    anova.list <- list()
    n <- length(resp)
    p.radius <- length(seq.radius)
    Y_ajus <- NULL
    treat <- factor(treat)
    for (i in 1:p.radius) {
        nb <- dnearneigh(coord, 0, seq.radius[i])
        w <- try(nb2mat(nb, style = "W"), silent = TRUE)
        test <- grepl("Error", w)
        k <- 0.1
        while (test[1] == TRUE) {
            seq.radius <- seq(0, (0.5 + k) * max.dist, l = 11)[-1]
            nb <- dnearneigh(coord, 0, seq.radius[i])
            w <- try(nb2mat(nb, style = "W"), silent = TRUE)
            test <- grepl("Error", w)
            k <- k + 0.1
        }
        listw <- nb2listw(nb, glist = NULL, style = "W")
        SAR <- lagsarlm(resp ~ treat, listw = listw, method = "eigen", 
            tol.solve = 1e-15)
        ajuste <- summary(SAR)
        rho <- as.numeric(ajuste["rho"]$rho)
        params[i, ] <- c(raio = seq.radius[i], rho = rho, AIC = AIC(SAR))
    }
    best.par <- which.min(params$AIC)
    beta <- mean(resp)
    nb <- dnearneigh(coord, 0, seq.radius[best.par])
    w <- nb2mat(nb, style = "W")
    Y_ajus <- resp - (params[best.par, "rho"] * w %*% resp - 
        params[best.par, "rho"] * beta)
    aov.cl <- anova(aov(resp ~ treat))
    model.adj <- aov(Y_ajus ~ treat)
    aov.adj <- anova(model.adj)
    Sqt.nadj <- sum(aov.cl[, 2])
    gltrat <- aov.adj[1][[1]][1]
    glerror <- aov.adj[1][[1]][2]
    gltot <- sum(gltrat, glerror)
    sqtrat <- aov.adj[2][[1]][1]
    sqerror <- aov.adj[2][[1]][2]
    sqtot <- sum(sqtrat, sqerror)
    sqtotcor <- Sqt.nadj - sqtot
    mstrat <- sqtrat/gltrat
    mserror <- sqerror/glerror
    ftrat <- mstrat/mserror
    pvalue <- pf(ftrat, gltrat, glerror, lower.tail = FALSE)
    name.y <- paste(deparse(substitute(resp)))
    name.x <- paste(deparse(substitute(treat)))
    outpt <- list(DF = round(c(gltrat, glerror, gltot), 0), SS = c(sqtrat, 
        sqerror, sqtotcor), MS = c(mstrat, mserror), Fc = c(ftrat), 
        residuals = resid(model.adj), p.value = c(pvalue), rho = params[best.par, 
            "rho"], Par = params, y_orig = resp, y_ajus = Y_ajus, 
        treat = treat, modelAdj = model.adj, modelstd = aov.cl, 
        namey = name.y, namex = name.x)
    class(outpt) <- c("SARanova", "SARcrd", class(aov.adj))
    return(outpt)
}
<bytecode: 0xaa398c8>
<environment: namespace:spANOVA>
 --- function search by body ---
Function aovSar.crd in namespace spANOVA has this body.
 ----------- END OF FAILURE REPORT -------------- 
Error in if (!(is.matrix(coord) | class(coord) == "SpatialPoints")) { : 
  the condition has length > 1
Calls: aovSar.crd
Execution halted