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   -6.43297107  91.828761 135.6863070
X2  -84.71094927  84.710949  74.6633330
X3   19.49841726  19.498417  18.0362117
X4  -10.61543831  92.548336 109.2595103
X5   57.23853226 107.277201 126.7556647
X6   55.23483908  55.234839  57.8234619
X7   31.15288670  31.152887  24.0307136
X8   40.32942190  40.329422   1.6961803
X9   33.57220705  33.572207   5.5310943
X10  46.22776067  46.227761   7.8381665
X11   7.77894152   7.778942   7.2777574
X12  -8.51763059  12.427413  11.2540722
X13   1.67832284   1.678323   0.6019454
X14  -1.53910300   2.566332   3.0053427
X15   6.17160902   6.171609   2.6361050
X16   4.90779768   4.907798   5.7142747
X17   4.91175932   4.911759   3.2180136
X18   0.07963299   1.975114   2.3991703
X19  -0.06155402   4.626930   5.4375199
X20   1.83517866   4.391825   6.3091500
> 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: 0x55dc501dbf80>
<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