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  -10.727039  90.900479 138.016136
X2  -90.401532  90.401532  79.187844
X3   21.071942  21.071942  19.929705
X4   -2.965771  96.462428 113.296339
X5   53.385736 107.776712 129.177021
X6   51.555895  55.090954  62.206313
X7   27.169926  27.169926  17.633062
X8   39.932263  39.932263   7.964492
X9   41.577522  41.577522   6.102345
X10  42.084291  42.084291   9.913488
X11   4.684541   5.064828   6.450374
X12  -3.860137   4.021861   4.724538
X13  -1.447602   1.918660   1.766027
X14  -4.242863   6.882179   7.260530
X15   4.787755   4.787755   2.295405
X16   5.088240   5.494469   6.732644
X17   1.169002   2.664589   3.456311
X18  -9.743108   9.743108   4.009292
X19  -1.794880   6.014019   7.570770
X20  -2.626492   8.955450  11.379452
> 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: 0x56113fdaac58>
<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