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  -11.9083274  89.033306 136.538781
X2  -91.5491760  91.549176  83.525426
X3   13.2340992  13.234099  10.081512
X4    1.0046038  90.237691 108.012730
X5   52.3841696 103.654359 123.108240
X6   53.8820937  53.882094  54.364955
X7   31.0340565  31.034057  23.169883
X8   33.5554877  33.555488   3.979924
X9   39.5414822  39.541482   2.525353
X10  36.4242859  36.424286   5.786262
X11   1.6098266   4.424897   5.215222
X12  -0.9316094   5.550632   7.559418
X13  -4.3268271   4.326827   4.774848
X14  -2.1088697   2.399257   3.055537
X15  -7.8312469   7.831247   3.414074
X16  -2.7163805   5.973074   6.909795
X17  10.3258418  10.325842   5.848888
X18  -3.6047217   4.692090   5.459352
X19   0.8457028   5.343168   6.197728
X20   0.7851519   4.066240   6.147159
> 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: 0x59e0ce0>
<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