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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: adjust_quantile
> ### Title: A function to compute the quantiles of pmax using either
> ###   approximation or exact method
> ### Aliases: adjust_quantile
> ### Keywords: composite null, joint significance, mediation
> 
> ### ** Examples
> 
> data(exampleinputdata)
> input_pvalues=snp_input
> #To save time for illustration, we use 10 percent of rows
> input_pvalues=input_pvalues[sample(1:nrow(input_pvalues),
+ size=ceiling(nrow(input_pvalues)/10)),]
> 
> nullprop <- nullestimation(input_pvalues,lambda=0.5)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
HDMT
 --- call from context --- 
nullestimation(input_pvalues, lambda = 0.5)
 --- call from argument --- 
if (!class(input_pvalues) %in% c("matrix", "data.frame")) stop("input_pvalues should be a matrix or data frame")
 --- R stacktrace ---
where 1: nullestimation(input_pvalues, lambda = 0.5)

 --- value of length: 2 type: logical ---
[1] FALSE  TRUE
 --- function from context --- 
function (input_pvalues, lambda = 0.5) 
{
    if (!class(input_pvalues) %in% c("matrix", "data.frame")) 
        stop("input_pvalues should be a matrix or data frame")
    if (ncol(input_pvalues) != 2) 
        stop("inpute_pvalues should have 2 column")
    input_pvalues <- matrix(as.numeric(input_pvalues), nrow = nrow(input_pvalues))
    if (sum(complete.cases(input_pvalues)) < nrow(input_pvalues)) 
        warning("input_pvalues contains NAs to be removed from analysis")
    input_pvalues <- input_pvalues[complete.cases(input_pvalues), 
        ]
    if (!is.null(nrow(input_pvalues)) & nrow(input_pvalues) < 
        1) 
        stop("input_pvalues doesn't have valid p-values")
    pcut <- seq(0.1, 0.8, 0.1)
    frac1 <- rep(0, 8)
    frac2 <- rep(0, 8)
    frac12 <- rep(0, 8)
    for (i in 1:8) {
        frac1[i] <- mean(input_pvalues[, 1] >= pcut[i])/(1 - 
            pcut[i])
        frac2[i] <- mean(input_pvalues[, 2] >= pcut[i])/(1 - 
            pcut[i])
        frac12[i] <- mean(input_pvalues[, 2] >= pcut[i] & input_pvalues[, 
            1] >= pcut[i])/(1 - pcut[i])^2
    }
    alpha00 <- min(frac12[pcut == lambda], 1)
    if (ks.test(input_pvalues[, 1], "punif", 0, 1)$p > 0.05) 
        alpha1 <- 1
    else alpha1 <- estim.pi0(p = input_pvalues[, 1], pi0.method = "slim")$pi0.SLIM
    if (ks.test(input_pvalues[, 2], "punif", 0, 1)$p > 0.05) 
        alpha2 <- 1
    else alpha2 <- estim.pi0(p = input_pvalues[, 2], pi0.method = "slim")$pi0.SLIM
    if (alpha1 == 1 | alpha2 == 1) {
        alpha11 <- 0
        alpha10 <- 1 - alpha1
        alpha01 <- 1 - alpha2
        if (alpha1 == 1 & alpha2 == 1) 
            alpha00 <- 1
        else {
            if (sum(alpha00 + alpha10 + alpha01) > 1) {
                err <- sum(alpha00 + alpha10 + alpha01) - 1
                alpha00 <- alpha00 - err
            }
            else {
                err <- 1 - sum(alpha00 + alpha10 + alpha01)
                if (alpha10 != 0) 
                  alpha10 <- alpha10 + err
                if (alpha01 != 0) 
                  alpha01 <- alpha01 + err
            }
        }
    }
    else {
        alpha11 <- max(1 - alpha1 + 1 - alpha2 + alpha00 - 1, 
            0)
        if (alpha11 == 0) {
            alpha10 <- 1 - alpha1
            alpha01 <- 1 - alpha2
            err <- 1 - (alpha00 + alpha10 + alpha01)
            alpha00 <- alpha00 + err
        }
        else {
            if (alpha11 > (1 - alpha1) | alpha11 > (1 - alpha2)) {
                alpha11 <- 0
                alpha10 <- 1 - alpha1
                alpha01 <- 1 - alpha2
                err <- 1 - (alpha00 + alpha10 + alpha01)
                alpha00 <- alpha00 + err
            }
            else {
                alpha10 <- max(1 - alpha1 - alpha11, 0)
                alpha01 <- max(1 - alpha2 - alpha11, 0)
                alpha00 <- 1 - alpha10 - alpha01 - alpha11
            }
        }
    }
    alpha.null <- list(alpha10 = alpha10, alpha01 = alpha01, 
        alpha00 = alpha00, alpha1 = alpha1, alpha2 = alpha2)
    return(alpha.null)
}
<bytecode: 0x55e70c1dc570>
<environment: namespace:HDMT>
 --- function search by body ---
Function nullestimation in namespace HDMT has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1