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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: aspect
> ### Title: Aspect or orientation of the slope
> ### Aliases: aspect
> 
> ### ** Examples
> 
> # Create a west-east facing ramp
> slpwe = rep(1,10)  %o% c(1:5,4:1)
> # calculate the aspect at every node or grid cell (it should be 270 or 90 degrees):
> cgr = cgrad(slpwe,1)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
insol
 --- call from context --- 
cgrad(slpwe, 1)
 --- call from argument --- 
if (class(dem) == "RasterLayer") {
    dlx = raster::res(dem)[1]
    dly = raster::res(dem)[2]
    dem = raster::as.matrix(dem)
}
 --- R stacktrace ---
where 1: cgrad(slpwe, 1)

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (dem, dlx = 0, dly = dlx, cArea = FALSE) 
{
    if (nargs() < 1) {
        cat("USAGE: cgrad(dem, dx, dly=dlx, cArea=FALSE) \n")
        return()
    }
    if (class(dem) == "RasterLayer") {
        dlx = raster::res(dem)[1]
        dly = raster::res(dem)[2]
        dem = raster::as.matrix(dem)
    }
    if (dlx == 0) {
        cat("Input data is not a RasterLayer, then I need the DEM resolution dlx \n")
        return()
    }
    mm = as.matrix(dem)
    rows = nrow(mm)
    cols = ncol(mm)
    cellgr = array(dim = c(rows, cols, 3))
    md = mm[-rows, -1]
    mr = mm[-1, -cols]
    mrd = mm[-1, -1]
    cellgr[-rows, -cols, 2] = 0.5 * dlx * (mm[-rows, -cols] + 
        md - mr - mrd)
    cellgr[-rows, -cols, 1] = 0.5 * dly * (mm[-rows, -cols] - 
        md + mr - mrd)
    cellgr[-rows, -cols, 3] = dlx * dly
    cellgr[rows, , ] = cellgr[(rows - 1), , ]
    cellgr[, cols, ] = cellgr[, (cols - 1), ]
    cellArea = sqrt(cellgr[, , 1]^2 + cellgr[, , 2]^2 + cellgr[, 
        , 3]^2)
    if (cArea) 
        return(cellArea)
    else {
        for (i in 1:3) cellgr[, , i] = cellgr[, , i]/cellArea
        return(cellgr)
    }
}
<bytecode: 0x1a2f4d8>
<environment: namespace:insol>
 --- function search by body ---
Function cgrad in namespace insol has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1