Error(s) in re-building vignettes:
  ...
--- re-building 'ExomeDepth-vignette.Rnw' using knitr
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
ExomeDepth
 --- call from context --- 
select.reference.set(test.counts = my.test, reference.counts = my.reference.set, 
    bin.length = (ExomeCount.dafr$end - ExomeCount.dafr$start)/1000, 
    n.bins.reduced = 10000)
 --- call from argument --- 
if (class(reference.counts) != "matrix") stop("The reference sequence count data must be provided as a matrix")
 --- R stacktrace ---
where 1: select.reference.set(test.counts = my.test, reference.counts = my.reference.set, 
    bin.length = (ExomeCount.dafr$end - ExomeCount.dafr$start)/1000, 
    n.bins.reduced = 10000)
where 2: eval(expr, envir, enclos)
where 3: eval(expr, envir, enclos)
where 4: withVisible(eval(expr, envir, enclos))
where 5: withCallingHandlers(withVisible(eval(expr, envir, enclos)), warning = wHandler, 
    error = eHandler, message = mHandler)
where 6: handle(ev <- withCallingHandlers(withVisible(eval(expr, envir, 
    enclos)), warning = wHandler, error = eHandler, message = mHandler))
where 7: timing_fn(handle(ev <- withCallingHandlers(withVisible(eval(expr, 
    envir, enclos)), warning = wHandler, error = eHandler, message = mHandler)))
where 8: 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 9: evaluate::evaluate(...)
where 10: 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 11: 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 12: block_exec(params)
where 13: call_block(x)
where 14: process_group.block(group)
where 15: process_group(group)
where 16: 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 17: process_file(text, output)
where 18: (if (grepl("\\.[Rr]md$", file)) knit2html_v1 else if (grepl("\\.[Rr]rst$", 
    file)) knit2pandoc else knit)(file, encoding = encoding, 
    quiet = quiet, envir = globalenv(), ...)
where 19: engine$weave(file, quiet = quiet, encoding = enc)
where 20: doTryCatch(return(expr), name, parentenv, handler)
where 21: tryCatchOne(expr, names, parentenv, handlers[[1L]])
where 22: tryCatchList(expr, classes, parentenv, handlers)
where 23: 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 24: tools:::buildVignettes(dir = "/home/hornik/tmp/R.check/r-devel-clang/Work/PKGS/ExomeDepth.Rcheck/vign_test/ExomeDepth", 
    ser_elibs = "/tmp/RtmpINAKLN/file654f17add61e.rds")

 --- value of length: 2 type: logical ---
[1] FALSE  TRUE
 --- function from context --- 
function (test.counts, reference.counts, bin.length = NULL, n.bins.reduced = 0, 
    data = NULL, formula = "cbind(test, reference) ~ 1", phi.bins = 1) 
{
    message("Optimization of the choice of aggregate reference set, this process can take some time")
    if (sum(test.counts > 2) < 5) {
        message("It looks like the test samples has only ", sum(test.counts > 
            2), " bins with 2 or more reads. The coverage is too small to perform any meaningful inference so no likelihood will be computed.")
        my.res <- list(reference.choice = dimnames(reference.counts)[[2]][1], 
            summary.stats = NULL)
        return(my.res)
    }
    if (class(reference.counts) != "matrix") 
        stop("The reference sequence count data must be provided as a matrix")
    if (nrow(reference.counts) != length(test.counts)) 
        stop("The number of rows of the reference matrix must match the length of the test count data\n")
    if (is.null(bin.length)) 
        bin.length <- rep(1, length(test.counts))
    n.ref.samples <- ncol(reference.counts)
    total.counts <- apply(reference.counts, MARGIN = 1, FUN = sum) + 
        test.counts
    my.quantiles <- quantile(total.counts[which(total.counts > 
        30)], prob = c(0.1, 0.9), na.rm = TRUE)
    selected <- which(total.counts > 30 & bin.length >= as.numeric(quantile(bin.length, 
        prob = 0.05, na.rm = TRUE)) & bin.length <= as.numeric(quantile(bin.length, 
        prob = 0.95, na.rm = TRUE)) & total.counts < my.quantiles[2])
    if ((n.bins.reduced < length(selected)) && (n.bins.reduced > 
        0)) 
        selected <- selected[seq(1, length(selected), length(selected)/n.bins.reduced)]
    test.counts <- test.counts[selected]
    reference.counts <- reference.counts[selected, , drop = FALSE]
    bin.length <- bin.length[selected]
    if (!is.null(data)) 
        data <- data[selected, ]
    n.bins <- length(selected)
    message("Number of selected bins: ", n.bins)
    my.correlations <- apply(reference.counts, MARGIN = 2, FUN = function(x) {
        cor(x/(bin.length * sum(x)/10^6), test.counts/(bin.length * 
            sum(test.counts)/10^6))
    })
    reference.counts <- reference.counts[, order(my.correlations, 
        decreasing = TRUE), drop = FALSE]
    my.correlations <- my.correlations[order(my.correlations, 
        decreasing = TRUE)]
    res.data.frame <- data.frame(ref.samples = dimnames(reference.counts)[[2]], 
        correlations = my.correlations, expected.BF = NA, phi = NA, 
        RatioSd = NA, mean.p = NA, median.depth = NA, selected = FALSE)
    reference <- rep(0, n.bins)
    for (i in 1:n.ref.samples) {
        reference <- reference + reference.counts[, i]
        my.mod <- new("ExomeDepth", test = test.counts, reference = reference, 
            formula = formula, data = data, phi.bins = phi.bins, 
            verbose = FALSE)
        res.data.frame$phi[i] <- mean(my.mod@phi)
        res.data.frame$mean.p[i] <- mean(my.mod@expected)
        res.data.frame$median.depth[i] <- median(reference)
        res.data.frame$RatioSd[i] <- mean(sqrt(1 + (test.counts + 
            reference - 1) * my.mod@phi))
        if ((i > 2) && (res.data.frame$mean.p[i] < 0.05)) 
            break
        alt.odds <- res.data.frame$mean.p[i]/(1 - res.data.frame$mean.p[i]) * 
            0.5
        alt.mean.p <- alt.odds/(1 + alt.odds)
        res.data.frame$expected.BF[i] <- get.power.betabinom(size = round(res.data.frame$median.depth[i]), 
            my.phi = res.data.frame$phi[i], my.p = res.data.frame$mean.p[i], 
            my.alt.p = alt.mean.p, theory = FALSE)
    }
    my.max <- which.max(res.data.frame$expected.BF)
    res.data.frame$selected[my.max] <- TRUE
    my.res <- list(reference.choice = as.character(res.data.frame$ref.samples[1:my.max]), 
        summary.stats = res.data.frame)
    return(my.res)
}
<bytecode: 0x12cfae18>
<environment: namespace:ExomeDepth>
 --- function search by body ---
Function select.reference.set in namespace ExomeDepth has this body.
 ----------- END OF FAILURE REPORT -------------- 
Quitting from lines 204-213 (ExomeDepth-vignette.Rnw) 
Error: processing vignette 'ExomeDepth-vignette.Rnw' failed with diagnostics:
the condition has length > 1
--- failed re-building 'ExomeDepth-vignette.Rnw'

SUMMARY: processing the following file failed:
  'ExomeDepth-vignette.Rnw'

Error: Vignette re-building failed.
Execution halted