Running examples in 'qrcm-Ex.R' failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: iqr
> ### Title: Quantile Regression Coefficients Modeling
> ### Aliases: iqr
> ### Keywords: models regression
> 
> ### ** Examples
> 
> 
>   ##### Using simulated data in all examples
> 
> 
>   ##### Example 1
>   
>   n <- 1000
>   x <- runif(n)
>   y <- rnorm(n, 1 + x, 1 + x)
>   # true quantile function: Q(p | x) = beta0(p) + beta1(p)*x, with 
>     # beta0(p) = beta1(p) = 1 + qnorm(p)
>                               
>   # fit the true model: b(p) = (1 , qnorm(p))
>   m1 <- iqr(y ~ x, formula.p = ~ I(qnorm(p)))
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
qrcm
 --- call from context --- 
iqr.newton(theta0, V$y, V$z, V$d, V$X, V$Xw, bfun, s = s, type = type, 
    tol = tol, maxit = maxit, safeit = safeit, eps0 = eps0)
 --- call from argument --- 
if (!err) {
    if (alg == "gs") {
        alg <- "nr"
        eps <- 1
    }
    delta <- (if (type == "iqr") 
        chol2inv(H1) %*% g
    else qr.solve(H1) %*% g)
} else {
    if (alg == "nr") {
        alg <- "gs"
        eps <- 1
    }
    delta <- g
}
 --- R stacktrace ---
where 1: iqr.newton(theta0, V$y, V$z, V$d, V$X, V$Xw, bfun, s = s, type = type, 
    tol = tol, maxit = maxit, safeit = safeit, eps0 = eps0)
where 2: ctiqr.internal(mf = mf, cl = cl, formula.p = formula.p, tol = tol, 
    maxit = maxit, s = s)
where 3: iqr(y ~ x, formula.p = ~I(qnorm(p)))

 --- value of length: 2 type: logical ---
[1] TRUE TRUE
 --- function from context --- 
function (theta, y, z, d, X, Xw, bfun, s, type, tol, maxit, safeit, 
    eps0) 
{
    if (type == "iqr") {
        ee <- iqr.ee
    }
    else if (type == "ciqr") {
        ee <- ciqr.ee
    }
    else {
        ee <- ctiqr.ee
    }
    q <- nrow(theta)
    k <- ncol(theta)
    s <- c(s == 1)
    p.star.y <- p.bisec.internal(theta, y, X, bfun$bp)
    if (type == "ctiqr") {
        p.star.z <- p.bisec.internal(theta, z, X, bfun$bp)
    }
    G <- ee(theta, y, z, d, X, Xw, bfun, p.star.y, p.star.z, 
        J = FALSE)
    g <- G$g[s]
    conv <- FALSE
    eps <- eps0
    for (i in 1:safeit) {
        if (conv | max(abs(g)) < tol) {
            break
        }
        u <- rep.int(0, q * k)
        u[s] <- g
        delta <- matrix(u, q, k)
        delta[is.na(delta)] <- 0
        cond <- FALSE
        while (!cond) {
            new.theta <- theta - delta * eps
            if (max(abs(delta * eps)) < tol) {
                conv <- TRUE
                break
            }
            p.star.y <- p.bisec.internal(new.theta, y, X, bfun$bp)
            if (type == "ctiqr") {
                p.star.z <- p.bisec.internal(new.theta, z, X, 
                  bfun$bp)
            }
            G1 <- ee(new.theta, y, z, d, X, Xw, bfun, p.star.y, 
                p.star.z, J = FALSE)
            g1 <- G1$g[s]
            cond <- (sum(g1^2) < sum(g^2))
            eps <- eps * 0.5
        }
        if (conv) {
            break
        }
        g <- g1
        G <- G1
        theta <- new.theta
        eps <- min(eps * 2, 0.1)
    }
    alg <- "nr"
    conv <- FALSE
    eps <- 0.1
    h <- ee(theta, y, z, d, X, Xw, bfun, p.star.y, p.star.z, 
        J = TRUE, G = G)$J[s, s, drop = FALSE]
    for (i in 1:maxit) {
        if (conv | max(abs(g)) < tol) {
            break
        }
        if (type == "iqr") {
            H1 <- try(chol(h), silent = TRUE)
            err <- (class(H1) == "try-error")
        }
        else {
            H1 <- qr(h)
            r <- H1$rank
            err <- (r != ncol(h))
        }
        if (!err) {
            if (alg == "gs") {
                alg <- "nr"
                eps <- 1
            }
            delta <- (if (type == "iqr") 
                chol2inv(H1) %*% g
            else qr.solve(H1) %*% g)
        }
        else {
            if (alg == "nr") {
                alg <- "gs"
                eps <- 1
            }
            delta <- g
        }
        u <- rep.int(0, q * k)
        u[s] <- delta
        delta <- matrix(u, q, k)
        delta[is.na(delta)] <- 0
        cond <- FALSE
        while (!cond) {
            new.theta <- theta - delta * eps
            if (max(abs(delta * eps)) < tol) {
                conv <- TRUE
                break
            }
            p.star.y <- p.bisec.internal(new.theta, y, X, bfun$bp)
            if (type == "ctiqr") {
                p.star.z <- p.bisec.internal(new.theta, z, X, 
                  bfun$bp)
            }
            G1 <- ee(new.theta, y, z, d, X, Xw, bfun, p.star.y, 
                p.star.z, J = FALSE)
            g1 <- G1$g[s]
            cond <- (sum(g1^2) < sum(g^2))
            eps <- eps * 0.5
        }
        if (conv) {
            break
        }
        g <- g1
        G <- G1
        theta <- new.theta
        h <- ee(theta, y, z, d, X, Xw, bfun, p.star.y, p.star.z, 
            J = TRUE, G = G)$J[s, s, drop = FALSE]
        if (i > 1) {
            eps <- min(eps * 10, 1)
        }
        else {
            eps <- min(eps * 10, 0.1)
        }
    }
    p.star.y <- p.bisec.internal(theta, y, X, bfun$bp)
    py <- bfun$p[p.star.y]
    if (type == "ctiqr") {
        p.star.z <- p.bisec.internal(theta, z, X, bfun$bp)
        pz <- bfun$p[p.star.z]
        pz <- pmin(pz, py - 1e-08)
        pz[p.star.z == 1] <- 0
    }
    else {
        p.star.z <- pz <- NULL
    }
    list(coefficients = matrix(theta, q, k), converged = (i < 
        maxit), n.it = i, p.star.y = p.star.y, p.star.z = p.star.z, 
        py = py, pz = pz, ee = g, jacobian = h, rank = (alg == 
            "nr") * sum(s))
}
<bytecode: 0x63ff320>
<environment: namespace:qrcm>
 --- function search by body ---
Function iqr.newton in namespace qrcm has this body.
 ----------- END OF FAILURE REPORT -------------- 
Error in if (!err) { : the condition has length > 1
Calls: iqr -> ctiqr.internal -> iqr.newton
Execution halted