Error(s) in re-building vignettes:
  ...
--- re-building 'MBHdesign.Rnw' using knitr
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
MBHdesign
 --- call from context --- 
setDesignParams(dimension, study.area, potential.sites, inclusion.probs)
 --- call from argument --- 
if (!class(study.area) %in% c("matrix", "data.frame")) study.area <- as.matrix(study.area)
 --- R stacktrace ---
where 1: setDesignParams(dimension, study.area, potential.sites, inclusion.probs)
where 2: quasiSamp(n = n, dimension = 2, study.area = matrix(c(0, 0, 0, 
    1, 1, 1, 1, 0), ncol = 2, byrow = TRUE), potential.sites = X, 
    inclusion.probs = altInclProbs)
where 3: eval(expr, envir, enclos)
where 4: eval(expr, envir, enclos)
where 5: withVisible(eval(expr, envir, enclos))
where 6: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, 
    error = eHandler, message = mHandler)
where 7: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, 
    enclos)), warning = wHandler, error = eHandler, message = mHandler))
where 8: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr, 
    envir, enclos)), warning = wHandler, error = eHandler, message = mHandler)))
where 9: evaluate_call(expr, parsed$src[[i]], envir = envir, enclos = enclos, 
    debug = debug, last = i == length(out), use_try = stop_on_error != 
        2L, keep_warning = keep_warning, keep_message = keep_message, 
    output_handler = output_handler, include_timing = include_timing)
where 10: evaluate::evaluate(...)
where 11: evaluate(code, envir = env, new_device = FALSE, keep_warning = !isFALSE(options$warning), 
    keep_message = !isFALSE(options$message), stop_on_error = if (options$error && 
        options$include) 0L else 2L, output_handler = knit_handlers(options$render, 
        options))
where 12: in_dir(input_dir(), evaluate(code, envir = env, new_device = FALSE, 
    keep_warning = !isFALSE(options$warning), keep_message = !isFALSE(options$message), 
    stop_on_error = if (options$error && options$include) 0L else 2L, 
    output_handler = knit_handlers(options$render, options)))
where 13: block_exec(params)
where 14: call_block(x)
where 15: process_group.block(group)
where 16: process_group(group)
where 17: withCallingHandlers(if (tangle) process_tangle(group) else process_group(group), 
    error = function(e) {
        setwd(wd)
        cat(res, sep = "\n", file = output %n% "")
        message("Quitting from lines ", paste(current_lines(i), 
            collapse = "-"), " (", knit_concord$get("infile"), 
            ") ")
    })
where 18: process_file(text, output)
where 19: (if (grepl("\\.[Rr]md$", file)) knit2html_v1 else if (grepl("\\.[Rr]rst$", 
    file)) knit2pandoc else knit)(file, encoding = encoding, 
    quiet = quiet, envir = globalenv(), ...)
where 20: engine$weave(file, quiet = quiet, encoding = enc)
where 21: doTryCatch(return(expr), name, parentenv, handler)
where 22: tryCatchOne(expr, names, parentenv, handlers[[1L]])
where 23: tryCatchList(expr, classes, parentenv, handlers)
where 24: tryCatch({
    engine$weave(file, quiet = quiet, encoding = enc)
    setwd(startdir)
    output <- find_vignette_product(name, by = "weave", engine = engine)
    if (!have.makefile && vignette_is_tex(output)) {
        texi2pdf(file = output, clean = FALSE, quiet = quiet)
        output <- find_vignette_product(name, by = "texi2pdf", 
            engine = engine)
    }
    outputs <- c(outputs, output)
}, error = function(e) {
    thisOK <<- FALSE
    fails <<- c(fails, file)
    message(gettextf("Error: processing vignette '%s' failed with diagnostics:\n%s", 
        file, conditionMessage(e)))
})
where 25: tools:::buildVignettes(dir = "/home/hornik/tmp/R.check/r-devel-clang/Work/PKGS/MBHdesign.Rcheck/vign_test/MBHdesign", 
    ser_elibs = "/tmp/RtmpAeL6dr/file2ff6f90f6d7.rds")

 --- value of length: 2 type: logical ---
[1] FALSE  TRUE
 --- function from context --- 
function (dimension, study.area, potential.sites, inclusion.probs) 
{
    if (is.null(study.area)) {
        if (is.null(potential.sites)) {
            message("No study.area defined and no potential.sites given. Using unit interval/square/cube/hyper-cube (as dimension dictates)")
            N <- 100
            potential.sites <- as.matrix(expand.grid(as.data.frame(matrix(rep(1:N, 
                times = dimension), ncol = dimension)))/N - 1/(2 * 
                N))
            study.area <- as.matrix(expand.grid(as.data.frame(matrix(c(rep(0, 
                dimension), rep(1, dimension)), nrow = 2, byrow = TRUE))))
            colnames(potential.sites) <- colnames(study.area) <- paste0("dimension", 
                1:dimension)
        }
        else {
            message("No study.area defined. Using an interval/rectangle/hyper-rectangle based on the extreme locations in potential.sites")
            if (!class(potential.sites) %in% c("matrix", "data.frame")) 
                potential.sites <- as.matrix(potential.sites)
            if (is.null(colnames(potential.sites))) 
                colnames(potential.sites) <- paste0("dimension", 
                  1:dimension)
            study.area <- as.matrix(expand.grid(as.data.frame(apply(potential.sites, 
                -1, range))))
            colnames(study.area) <- colnames(potential.sites)
        }
        if (dimension == 2) 
            study.area <- study.area[c(1, 3, 4, 2), ]
    }
    if (!class(study.area) %in% c("matrix", "data.frame")) 
        study.area <- as.matrix(study.area)
    if (is.null(colnames(study.area))) 
        colnames(study.area) <- paste0("dimension", 1:dimension)
    if (is.null(potential.sites)) {
        message("Sampling from a 100x100 grid (max -- will be cropped) within the study area (well hyper-rectangle if dimension>2)")
        N <- 100
        potential.sites <- as.matrix(expand.grid(as.data.frame(matrix(rep(1:N, 
            times = dimension), ncol = dimension)))/N - 1/(2 * 
            N))
        colnames(potential.sites) <- paste0("dimension", 1:dimension)
        myRange <- apply(study.area, -1, range)
        for (ii in 1:dimension) {
            potential.sites[, ii] <- myRange[1, ii] + (myRange[2, 
                ii] - myRange[1, ii]) * potential.sites[, ii]
        }
        if (dimension == 2) {
            tmp <- mgcv::in.out(study.area, potential.sites)
            potential.sites <- potential.sites[tmp, ]
        }
        if (dimension > 2) 
            message("Sampling grid not checked for interior of study area (please do so yourself)")
    }
    N <- nrow(potential.sites)
    if (dimension != ncol(potential.sites)) 
        stop("The dimension supplied does not match the dimension that the potential.sites implies")
    if (is.null(inclusion.probs)) {
        message("No inclusion.probs supplied, assuming uniform")
        inclusion.probs <- rep(1/N, N)
    }
    inclusion.probs1 <- inclusion.probs/max(inclusion.probs, 
        na.rm = TRUE)
    ret <- list(dimension = dimension, study.area = study.area, 
        potential.sites = potential.sites, inclusion.probs = inclusion.probs, 
        inclusion.probs1 = inclusion.probs1, N = N)
    return(ret)
}
<bytecode: 0xa3382e8>
<environment: namespace:MBHdesign>
 --- function search by body ---
Function setDesignParams in namespace MBHdesign has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1