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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: morris
> ### Title: Morris's Elementary Effects Screening Method
> ### Aliases: morris tell.morris print.morris plot.morris plot3d.morris
> ### Keywords: design
> 
> ### ** Examples
> 
> # Test case : the non-monotonic function of Morris
> x <- morris(model = morris.fun, factors = 20, r = 4,
+             design = list(type = "oat", levels = 5, grid.jump = 3))
> print(x)

Call:
morris(model = morris.fun, factors = 20, r = 4, design = list(type = "oat",     levels = 5, grid.jump = 3))

Model runs: 84 
             mu    mu.star      sigma
X1   -4.7978431  95.851447 139.001076
X2  -85.6359828  85.635983  85.101609
X3   17.2309331  17.230933  17.094204
X4   -6.1666381  92.771914 110.037890
X5   60.2086702 107.716945 125.526526
X6   50.0090370  52.399975  60.801600
X7   29.3473289  29.347329  21.784015
X8   45.0303493  45.030349   5.225263
X9   38.8866010  38.886601   9.605822
X10  28.0231982  28.023198   5.597925
X11   2.6637488   2.863978   2.450971
X12  -3.6136310   4.802518   4.541366
X13   2.5073647   4.811769   5.737778
X14  -1.0614797   1.583920   2.463947
X15   0.7091063   4.564723   5.647590
X16  -4.7492096   6.399949   5.507702
X17   6.9178634   6.917863   6.931568
X18  -6.4913592  10.034206   9.323149
X19  -6.4532419   6.732398   5.718351
X20   5.4041158   5.404116   1.358751
> plot(x)
> 
> # Only for demonstration purposes: a model function returning a matrix
> morris.fun_matrix <- function(X){
+   res_vector <- morris.fun(X)
+   cbind(res_vector, 2 * res_vector)
+ }
> x <- morris(model = morris.fun_matrix, factors = 20, r = 4,
+             design = list(type = "oat", levels = 5, grid.jump = 3))
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
sensitivity
 --- call from context --- 
ee.oat(X, y)
 --- call from argument --- 
if (class(y) == "numeric") {
    one_i_vector <- function(i) {
        j <- ind.rep(i, p)
        j1 <- j[1:p]
        j2 <- j[2:(p + 1)]
        return(solve(X[j2, ] - X[j1, ], y[j2] - y[j1]))
    }
    ee <- vapply(1:r, one_i_vector, FUN.VALUE = numeric(p))
    ee <- t(ee)
} else if (class(y) == "matrix") {
    one_i_matrix <- function(i) {
        j <- ind.rep(i, p)
        j1 <- j[1:p]
        j2 <- j[2:(p + 1)]
        return(solve(X[j2, ] - X[j1, ], y[j2, , drop = FALSE] - 
            y[j1, , drop = FALSE]))
    }
    ee <- vapply(1:r, one_i_matrix, FUN.VALUE = matrix(0, nrow = p, 
        ncol = ncol(y)))
    if (p == 1 && ncol(y) == 1) {
        ee <- array(ee, dim = c(r, 1, 1))
    }
    ee <- aperm(ee, perm = c(3, 1, 2))
} else if (class(y) == "array") {
    one_i_array <- function(i) {
        j <- ind.rep(i, p)
        j1 <- j[1:p]
        j2 <- j[2:(p + 1)]
        ee_per_3rd_dim <- sapply(1:(dim(y)[3]), function(idx_3rd_dim) {
            y_j2_matrix <- y[j2, , idx_3rd_dim]
            y_j1_matrix <- y[j1, , idx_3rd_dim]
            solve(X[j2, ] - X[j1, ], y_j2_matrix - y_j1_matrix)
        }, simplify = "array")
        if (dim(y)[2] == 1) {
            ee_per_3rd_dim <- array(ee_per_3rd_dim, dim = c(p, 
                dim(y)[2], dim(y)[3]))
        }
        else if (p == 1) {
            ee_per_3rd_dim <- array(ee_per_3rd_dim, dim = c(1, 
                dim(y)[2], dim(y)[3]))
        }
        if (is.null(dimnames(ee_per_3rd_dim))) {
            dimnames(ee_per_3rd_dim) <- dimnames(y)
        }
        else {
            dimnames(ee_per_3rd_dim)[[3]] <- dimnames(y)[[3]]
        }
        return(ee_per_3rd_dim)
    }
    ee <- sapply(1:r, one_i_array, simplify = "array")
    if (class(ee) == "numeric") {
        ee <- array(ee, dim = c(p, dim(y)[2], dim(y)[3], r))
        dimnames(ee) <- list(NULL, dimnames(y)[[2]], dimnames(y)[[3]], 
            NULL)
    }
    ee <- aperm(ee, perm = c(4, 1, 2, 3))
}
 --- R stacktrace ---
where 1: ee.oat(X, y)
where 2: tell.morris(x)
where 3: tell(x)
where 4: morris(model = morris.fun_matrix, factors = 20, r = 4, design = list(type = "oat", 
    levels = 5, grid.jump = 3))

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (X, y) 
{
    p <- ncol(X)
    r <- nrow(X)/(p + 1)
    if (class(y) == "numeric") {
        one_i_vector <- function(i) {
            j <- ind.rep(i, p)
            j1 <- j[1:p]
            j2 <- j[2:(p + 1)]
            return(solve(X[j2, ] - X[j1, ], y[j2] - y[j1]))
        }
        ee <- vapply(1:r, one_i_vector, FUN.VALUE = numeric(p))
        ee <- t(ee)
    }
    else if (class(y) == "matrix") {
        one_i_matrix <- function(i) {
            j <- ind.rep(i, p)
            j1 <- j[1:p]
            j2 <- j[2:(p + 1)]
            return(solve(X[j2, ] - X[j1, ], y[j2, , drop = FALSE] - 
                y[j1, , drop = FALSE]))
        }
        ee <- vapply(1:r, one_i_matrix, FUN.VALUE = matrix(0, 
            nrow = p, ncol = ncol(y)))
        if (p == 1 && ncol(y) == 1) {
            ee <- array(ee, dim = c(r, 1, 1))
        }
        ee <- aperm(ee, perm = c(3, 1, 2))
    }
    else if (class(y) == "array") {
        one_i_array <- function(i) {
            j <- ind.rep(i, p)
            j1 <- j[1:p]
            j2 <- j[2:(p + 1)]
            ee_per_3rd_dim <- sapply(1:(dim(y)[3]), function(idx_3rd_dim) {
                y_j2_matrix <- y[j2, , idx_3rd_dim]
                y_j1_matrix <- y[j1, , idx_3rd_dim]
                solve(X[j2, ] - X[j1, ], y_j2_matrix - y_j1_matrix)
            }, simplify = "array")
            if (dim(y)[2] == 1) {
                ee_per_3rd_dim <- array(ee_per_3rd_dim, dim = c(p, 
                  dim(y)[2], dim(y)[3]))
            }
            else if (p == 1) {
                ee_per_3rd_dim <- array(ee_per_3rd_dim, dim = c(1, 
                  dim(y)[2], dim(y)[3]))
            }
            if (is.null(dimnames(ee_per_3rd_dim))) {
                dimnames(ee_per_3rd_dim) <- dimnames(y)
            }
            else {
                dimnames(ee_per_3rd_dim)[[3]] <- dimnames(y)[[3]]
            }
            return(ee_per_3rd_dim)
        }
        ee <- sapply(1:r, one_i_array, simplify = "array")
        if (class(ee) == "numeric") {
            ee <- array(ee, dim = c(p, dim(y)[2], dim(y)[3], 
                r))
            dimnames(ee) <- list(NULL, dimnames(y)[[2]], dimnames(y)[[3]], 
                NULL)
        }
        ee <- aperm(ee, perm = c(4, 1, 2, 3))
    }
    return(ee)
}
<bytecode: 0x56501892ed98>
<environment: namespace:sensitivity>
 --- function search by body ---
Function ee.oat in namespace sensitivity has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1