Running examples in ‘isocat-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: cumsumAtSamplingLocation
> ### Title: Cumulative sum at coordinates
> ### Aliases: cumsumAtSamplingLocation
> 
> ### ** Examples
> 
> # Generate example probability surface.
> myiso <- raster::rasterFromXYZ(isoscape)
> myiso_sd <- rasterFromXYZ(isoscape_sd)
> exampleSurface <- isotopeAssignmentModel(
+          ID = "A",
+          isotopeValue = -100,
+          SD_indv = 5,
+          precip_raster = myiso,
+          precip_SD_raster = myiso_sd,
+          nClusters = FALSE
+          )
> # Calculate odds ratio at specific point.
> set.seed(1)
> x <- sample( which( !is.na(exampleSurface[]) ), size = 1)
> pt <- raster::xyFromCell(exampleSurface, x)
> cumsumAtSamplingLocation(exampleSurface, Lat = pt[2], Lon = pt[1])
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
isocat
 --- call from context --- 
cumsumAtSamplingLocation(exampleSurface, Lat = pt[2], Lon = pt[1])
 --- call from argument --- 
if (class(p_atPoint) == "matrix") {
    if (length(p_atPoint) != 1) {
        stop("extracted value at coordinates must be of length one.")
    }
    else p_atPoint <- as.numeric(p_atPoint)
}
 --- R stacktrace ---
where 1: cumsumAtSamplingLocation(exampleSurface, Lat = pt[2], Lon = pt[1])

 --- value of length: 2 type: logical ---
[1]  TRUE FALSE
 --- function from context --- 
function (indivraster, Lat, Lon) 
{
    if (!is.numeric(Lat) | !is.numeric(Lon)) 
        stop("'Lat' and 'Lon' must both be numeric values.")
    if (is.na(Lat) | is.na(Lon)) {
        return(NA)
    }
    else {
        indivcoords <- sp::SpatialPoints(cbind(Lon, Lat))
        p_atPoint <- raster::extract(indivraster, indivcoords)
        if (class(p_atPoint) == "matrix") {
            if (length(p_atPoint) != 1) {
                stop("extracted value at coordinates must be of length one.")
            }
            else p_atPoint <- as.numeric(p_atPoint)
        }
        vals <- stats::na.omit(indivraster[])
        cumsumAtPoint <- vals[vals <= p_atPoint] %>% sum(na.rm = TRUE)
        return(cumsumAtPoint)
    }
}
<bytecode: 0x55b7667b1c20>
<environment: namespace:isocat>
 --- function search by body ---
Function cumsumAtSamplingLocation in namespace isocat has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1