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

> ### Name: PolToCar
> ### Title: Conversion of spherical coordinates to 3d Cartesian coordinates
> ### Aliases: PolToCar
> 
> ### ** Examples
> 
> longLat <- rbind(
+     c(0,0),
+     #note the precision here!
+     c(0, 90),
+     c(-45,12)
+ )
> 
> xyz <- PolToCar(longLat)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
icosa
 --- call from context --- 
PolToCar(longLat)
 --- call from argument --- 
if (!class(longLatMat) %in% c("matrix", "data.frame")) {
    stop("Invalid input.")
}
 --- R stacktrace ---
where 1: PolToCar(longLat)

 --- value of length: 2 type: logical ---
[1] FALSE  TRUE
 --- function from context --- 
function (longLatMat, radius = authRadius, origin = c(0, 0, 0)) 
{
    if (!class(longLatMat) %in% c("matrix", "data.frame")) {
        stop("Invalid input.")
    }
    if ((class(longLatMat[, 1]) == "numeric") + (class(longLatMat[, 
        2]) == "numeric") != 2) {
        stop("Invalid input matrix or data frame.")
    }
    boolNA <- (is.na(longLatMat[, 1]) | is.na(longLatMat[, 2]))
    longLat <- longLatMat[!boolNA, , drop = FALSE]
    if (length(radius) != 1 | !is.numeric(radius)) 
        stop("Invalid 'radius' value.")
    if (max(abs(longLat[, 2])) > 90) 
        stop("Latitudinal data should be in the second column of the matrix.")
    x <- cos(longLat[, 2]/180 * pi) * cos(longLat[, 1]/180 * 
        pi)
    y <- cos(longLat[, 2]/180 * pi) * sin(longLat[, 1]/180 * 
        pi)
    z <- sin(longLat[, 2]/180 * pi)
    newMat <- matrix(NA, ncol = 3, nrow = nrow(longLatMat))
    newMat[!boolNA, ] <- cbind(x, y, z)
    colnames(newMat) <- c("x", "y", "z")
    endRes <- newMat * radius
    endRes[, 1] <- endRes[, 1] + origin[1]
    endRes[, 2] <- endRes[, 2] + origin[2]
    endRes[, 3] <- endRes[, 3] + origin[3]
    return(endRes)
}
<bytecode: 0xb2856e8>
<environment: namespace:icosa>
 --- function search by body ---
Function PolToCar in namespace icosa has this body.
 ----------- END OF FAILURE REPORT -------------- 
Error in if (!class(longLatMat) %in% c("matrix", "data.frame")) { : 
  the condition has length > 1
Calls: PolToCar
Execution halted