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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: accCost
> ### Title: Accumulated Cost Surface
> ### Aliases: accCost accCost,TransitionLayer,RasterLayer-method
> ###   accCost,TransitionLayer,Coords-method
> ### Keywords: spatial
> 
> ### ** Examples
> 
> #example equivalent to that in the documentation on r.cost in GRASS
> r <- raster(nrows=6, ncols=7, xmn=0, xmx=7, ymn=0, ymx=6, crs="+proj=utm +units=m")
>  
> r[] <- c(2, 2, 1, 1, 5, 5, 5,
+          2, 2, 8, 8, 5, 2, 1,
+          7, 1, 1, 8, 2, 2, 2,
+          8, 7, 8, 8, 8, 8, 5,
+          8, 8, 1, 1, 5, 3, 9,
+          8, 1, 1, 2, 5, 3, 9)
> 
> T <- transition(r, function(x) 1/mean(x), 8) 
> # 1/mean: reciprocal to get permeability
> T <- geoCorrection(T)
> 
> c1 <- c(5.5,1.5) 
> c2 <- c(1.5,5.5)
> 
> A <- accCost(T, c1)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
gdistance
 --- call from context --- 
.coordsToMatrix(fromCoords)
 --- call from argument --- 
if (class(Coords) == "matrix") {
    if (!(ncol(Coords) == 2)) {
        stop("coordinates given as a matrix, but the matrix does not have two columns")
    }
}
 --- R stacktrace ---
where 1: .coordsToMatrix(fromCoords)
where 2: accCost(T, c1)
where 3: accCost(T, c1)

 --- value of length: 2 type: logical ---
[1]  TRUE FALSE
 --- function from context --- 
function (Coords) 
{
    if (class(Coords) == "numeric") {
        if (length(Coords) == 2) {
            Coords <- t(as.matrix(Coords))
        }
        else {
            stop("coordinates given as a vector, but the vector does not have a length of two")
        }
    }
    if (class(Coords) == "matrix") {
        if (!(ncol(Coords) == 2)) {
            stop("coordinates given as a matrix, but the matrix does not have two columns")
        }
    }
    if (inherits(Coords, "SpatialPoints")) {
        Coords <- coordinates(Coords)
    }
    return(Coords)
}
<bytecode: 0x1256b160>
<environment: namespace:gdistance>
 --- function search by body ---
Function .coordsToMatrix in namespace gdistance has this body.
 ----------- END OF FAILURE REPORT -------------- 
Error in if (class(Coords) == "matrix") { : the condition has length > 1
Calls: accCost -> accCost -> .coordsToMatrix
Execution halted