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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: clouds
> ### Title: Create a cloud mask from Landsat bands 1 and 6.
> ### Aliases: clouds
> ### Keywords: spatial
> 
> ### ** Examples
> 
> data(july1)
> data(july61)
> july.cloud <- clouds(july1, july61)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
landsat
 --- call from context --- 
movingwindow(matrix(cloudmask, nrow = dims[1], ncol = dims[2]), 
    matrix(rep(1, buffer * buffer), buffer, buffer))
 --- call from argument --- 
if (class(results) == "SpatialGridDataFrame") results@data[, 
    1] <- as.vector(newmat) else if (is.data.frame(results)) results <- data.frame(matrix(newmat, 
    nrow = nrow(results), ncol = ncol(results))) else if (is.matrix(results)) results <- matrix(newmat, 
    nrow = nrow(results), ncol = ncol(results))
 --- R stacktrace ---
where 1: movingwindow(matrix(cloudmask, nrow = dims[1], ncol = dims[2]), 
    matrix(rep(1, buffer * buffer), buffer, buffer))
where 2: clouds(july1, july61)

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (x, kernel) 
{
    results <- x
    x <- as.matrix(x)
    mwoffset <- (nrow(kernel) - 1)/2
    newmat <- matrix(NA, nrow = nrow(x), ncol = ncol(x))
    for (i in (1 + mwoffset):(nrow(x) - mwoffset)) {
        for (j in (1 + mwoffset):(ncol(x) - mwoffset)) {
            newmat[i, j] <- sum(kernel * x[(i - mwoffset):(i + 
                mwoffset), (j - mwoffset):(j + mwoffset)])
        }
    }
    if (class(results) == "SpatialGridDataFrame") 
        results@data[, 1] <- as.vector(newmat)
    else if (is.data.frame(results)) 
        results <- data.frame(matrix(newmat, nrow = nrow(results), 
            ncol = ncol(results)))
    else if (is.matrix(results)) 
        results <- matrix(newmat, nrow = nrow(results), ncol = ncol(results))
    results
}
<bytecode: 0x5fe5bf0>
<environment: namespace:landsat>
 --- function search by body ---
Function movingwindow in namespace landsat has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1