Running examples in ‘AssayCorrector-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: correct_bias
> ### Title: Correct the bias present in the assay, previously detected by
> ###   the 'detect_bias()' method
> ### Aliases: correct_bias
> 
> ### ** Examples
> 
> assay<-create_assay(m)
> detected<-detect_bias(assay)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
AssayCorrector
 --- call from context --- 
detect_bias(assay)
 --- call from argument --- 
if (class(m.E[[ac(model)]][, , k]) == "try-error") stop("PMP encountered a problem")
 --- R stacktrace ---
where 1: detect_bias(assay)

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (assay, alpha = 0.01, type = "P", test = "AD") 
{
    if (class(assay) != "assay") 
        stop("Error: This is not an assay.")
    ac = as.character
    m = assay$m
    ctrl = assay$ctrl
    biasType = assay$biasType
    biasModel = assay$biasModel
    biasConf = assay$biasConf
    PMPmapping = c(1, 4, 5, 3, 2, 6)
    m.E <- new.env()
    for (model in 1:6) {
        m.E[[ac(model)]] = ctrl
    }
    dimensions = dim(m)
    Depth = dimensions[3]
    .test.f = NULL
    if (test == "KS") 
        .test.f = function(x, y) ks.test(x, y)$p.value
    else if (test == "AD") 
        .test.f = function(x, y) as.numeric(tail(strsplit(capture.output(kSamples::ad.test(x, 
            y))[17], " ")[[1]], 1))
    else if (test == "CVM") 
        .test.f = function(x, y) RVAideMemoire::CvM.test(x, y)$p.value
    else {
        stop("Error: This is not a valid test. Please use KS, AD or CVM")
    }
    if (type == "AP") 
        m = .assay(m, ctrl, alpha)
    for (k in 1:Depth) {
        for (model in 1:6) {
            m.E[[ac(model)]][, , k] = try(.PMP(m[, , k], ctrl[, 
                , k], PMPmapping[model], alpha))
            if (class(m.E[[ac(model)]][, , k]) == "try-error") 
                stop("PMP encountered a problem")
        }
        mww = (m.E[[ac(1)]][, , k] != m[, , k]) * 1
        assay$biasPositions[, , k] = mww
        biased.E = new.env()
        unbiased = list()
        for (i in 1:dimensions[1]) {
            for (j in 1:dimensions[2]) {
                if (mww[i, j] & !ctrl[i, j, k]) {
                  for (model in 1:6) {
                    biased.E[[ac(model)]] = c(biased.E[[ac(model)]], 
                      m.E[[ac(model)]][i, j, k])
                  }
                }
                else if (!mww[i, j] & !ctrl[i, j, k]) 
                  unbiased = c(unbiased, m.E[[ac(model)]][i, 
                    j, k])
            }
        }
        for (model in 1:6) {
            biased.E[[ac(model)]] = unlist(biased.E[[ac(model)]])
        }
        unbiased = unlist(unbiased)
        if (Reduce(function(x, y) length(biased.E[[ac(y)]]) * 
            x, 1:6, 1) == 0) {
            biasType[k] = "C"
            next
        }
        pvalue.E = new.env()
        for (model in 1:6) {
            pvalue.E[[ac(model)]] = .test.f(biased.E[[ac(model)]], 
                unbiased)
        }
        aMethods = 1:3
        mMethods = 4:6
        p = function(model) pvalue.E[[ac(model)]]
        if (all(sapply(aMethods, p) < alpha) & any(sapply(mMethods, 
            p) > alpha)) {
            biasType[k] = "M"
            biasModel[k] = 3 + which.max(sapply(mMethods, p))
            biasConf[k] = sum(sapply(mMethods, p) > alpha)
        }
        else if (all(sapply(mMethods, p) < alpha) & any(sapply(aMethods, 
            p) > alpha)) {
            biasType[k] = "A"
            biasModel[k] = which.max(sapply(aMethods, p))
            biasConf[k] = sum(sapply(aMethods, p) > alpha)
        }
        else if (all(sapply(mMethods, p) < alpha) & all(sapply(aMethods, 
            p) < alpha)) {
            biasType[k] = "U"
        }
        else if (all(sapply(mMethods, p) > alpha) & all(sapply(aMethods, 
            p) > alpha)) {
            biasModel[k] = which.max(sapply(c(aMethods, mMethods), 
                p))
            biasConf[k] = sum(sapply(c(aMethods, mMethods), p) > 
                alpha)
            biasType[k] = ifelse(biasModel[k] %in% aMethods, 
                "A", "M")
        }
        else {
            biasType[k] = "U"
        }
    }
    assay$biasType = biasType
    assay$biasModel = biasModel
    assay$biasConf = biasConf
    return(assay)
}
<bytecode: 0x55932ed02428>
<environment: namespace:AssayCorrector>
 --- function search by body ---
Function detect_bias in namespace AssayCorrector has this body.
 ----------- END OF FAILURE REPORT -------------- 
Error in if (class(m.E[[ac(model)]][, , k]) == "try-error") stop("PMP encountered a problem") : 
  the condition has length > 1
Calls: detect_bias
Execution halted