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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: image.cov
> ### Title: Exponential, Matern and general covariance functions for 2-d
> ###   gridded locations.
> ### Aliases: stationary.image.cov Exp.image.cov Rad.image.cov
> ###   wendland.image.cov matern.image.cov
> ### Keywords: spatial
> 
> ### ** Examples
> 
> # multiply 2-d isotropic exponential with theta=4 by a random vector 
> 
> junk<- matrix(rnorm(100*100), 100,100)
> 
> cov.obj<- stationary.image.cov( setup=TRUE, 
+              grid=list(x=1:100,y=1:100),theta=8) 
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
fields
 --- call from context --- 
stationary.image.cov(setup = TRUE, grid = list(x = 1:100, y = 1:100), 
    theta = 8)
 --- call from argument --- 
if (class(out) == "spam") {
    out <- spam2full(out)
}
 --- R stacktrace ---
where 1: stationary.image.cov(setup = TRUE, grid = list(x = 1:100, y = 1:100), 
    theta = 8)

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (ind1, ind2, Y, cov.obj = NULL, setup = FALSE, grid, 
    M = NULL, N = NULL, cov.function = "stationary.cov", delta = NULL, 
    cov.args = NULL, ...) 
{
    cov.args <- c(cov.args, list(...))
    if (is.null(cov.obj)) {
        dx <- grid$x[2] - grid$x[1]
        dy <- grid$y[2] - grid$y[1]
        m <- length(grid$x)
        n <- length(grid$y)
        if (!is.null(delta)) {
            M <- ceiling(m + 2 * delta/dx)
            N <- ceiling(n + 2 * delta/dy)
        }
        if (is.null(M)) 
            M <- (2 * m)
        if (is.null(N)) 
            N <- (2 * n)
        xg <- make.surface.grid(list((1:M) * dx, (1:N) * dy))
        center <- matrix(c((dx * M)/2, (dy * N)/2), nrow = 1, 
            ncol = 2)
        out <- do.call(cov.function, c(cov.args, list(x1 = xg, 
            x2 = center)))
        if (class(out) == "spam") {
            out <- spam2full(out)
        }
        out <- matrix(c(out), nrow = M, ncol = N)
        temp <- matrix(0, nrow = M, ncol = N)
        temp[M/2, N/2] <- 1
        wght <- fft(out)/(fft(temp) * M * N)
        cov.obj <- list(m = m, n = n, grid = grid, N = N, M = M, 
            wght = wght, call = match.call())
        if (setup) {
            return(cov.obj)
        }
    }
    temp <- matrix(0, nrow = cov.obj$M, ncol = cov.obj$N)
    if (missing(ind1)) {
        temp[1:cov.obj$m, 1:cov.obj$n] <- Y
        Re(fft(fft(temp) * cov.obj$wght, inverse = TRUE)[1:cov.obj$m, 
            1:cov.obj$n])
    }
    else {
        if (missing(ind2)) {
            temp[ind1] <- Y
        }
        else {
            temp[ind2] <- Y
        }
        Re(fft(fft(temp) * cov.obj$wght, inverse = TRUE)[ind1])
    }
}
<bytecode: 0x49755b0>
<environment: namespace:fields>
 --- function search by body ---
Function stationary.image.cov in namespace fields has this body.
 ----------- END OF FAILURE REPORT -------------- 
Error in if (class(out) == "spam") { : the condition has length > 1
Calls: stationary.image.cov
Execution halted