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  -13.0104358  87.9110700 133.857207
X2  -85.3380066  85.3380066  74.214927
X3   16.4990748  16.4990748  16.412343
X4   -3.9429246  87.7841146 104.423016
X5   52.9750348 112.2755380 133.722681
X6   53.0639705  53.5647089  57.213069
X7   28.8166734  28.8166734  21.517771
X8   39.2121518  39.2121518   5.968320
X9   43.6613835  43.6613835  10.214645
X10  34.3705322  34.3705322   5.724179
X11  -3.0942455   4.0433048   4.787975
X12   0.7259717   3.4367647   4.573830
X13  -6.5036435   6.5036435   5.519749
X14  -5.6621704   7.9266942   7.491482
X15  -6.7115535   6.7115535   6.648634
X16   0.2339517   0.9056497   1.341237
X17   5.7752495   5.7752495   5.749358
X18  -3.9022618   3.9022618   1.978755
X19   2.5406092   3.0904840   3.461932
X20  -5.1172959   5.1172959   2.833158
> 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: 0x564be1620e80>
<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