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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: hierNet
> ### Title: A Lasso for interactions
> ### Aliases: hierNet
> 
> ### ** Examples
> 
> set.seed(12)
> # fit a single hierNet model
> x=matrix(rnorm(100*10),ncol=10)
> x=scale(x,TRUE,TRUE)
> y=x[,1]+2*x[,2]+ x[,1]*x[,2]+3*rnorm(100)
> fit=hierNet(x,y,lam=50)
GG converged in 31 iterations.
> print(fit)
Call:
hierNet(x = x, y = y, lam = 50)

Non-zero coefficients:
  (Rows are predictors with nonzero main effects)
  (1st column is main effect)
  (Next columns are nonzero interactions of row predictor)
  (Last column indicates whether hierarchy constraint is tight.)

  Main effect 1      2      3       Tight?
1 0.2836      0      0.6513 0       *     
2 1.019       0.6513 0      0             
3 0.1289      0      0      -0.1289 *     
7 0.2373      0      0      0             
> 
> # try strong (rather than weak) hierarchy
> fit=hierNet(x,y,lam=50, strong=TRUE)
GG converged in 20 iterations.
Theta is not symmetric.
GG converged in 18 iterations.
Theta is not symmetric.
GG converged in 12 iterations.
Theta is not symmetric.
GG converged in 10 iterations.
Theta is not symmetric.
GG converged in 11 iterations.
Theta is not symmetric.
GG converged in 10 iterations.
Theta is not symmetric.
GG converged in 9 iterations.
Theta is not symmetric.
GG converged in 8 iterations.
Theta is not symmetric.
GG converged in 7 iterations.
GG converged in 5 iterations.
GG converged in 2 iterations.
GG converged in 2 iterations.
GG converged in 2 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
GG converged in 1 iterations.
> print(fit)
Call:
hierNet(x = x, y = y, lam = 50, strong = TRUE)

Non-zero coefficients:
  (Rows are predictors with nonzero main effects)
  (1st column is main effect)
  (Next columns are nonzero interactions of row predictor)
  (Last column indicates whether hierarchy constraint is tight.)

  Main effect 1      2      3       Tight?
1 0.4974      0      0.4974 0             
2 0.8839      0.4974 0      0             
3 0.1218      0      0      -0.1218 *     
7 0.2866      0      0      0             
> 
> # a typical analysis including cross-validation
> set.seed(12)
> x=matrix(rnorm(100*10),ncol=10)
> x=scale(x,TRUE,TRUE)
> y=x[,1]+2*x[,2]+ x[,1]*x[,2]+3*rnorm(100)
> fit=hierNet.path(x,y)
i,lam= 1 129.72
GG converged in 1 iterations.
i,lam= 2 101.8
GG converged in 20 iterations.
i,lam= 3 79.89
GG converged in 26 iterations.
i,lam= 4 62.69
GG converged in 26 iterations.
i,lam= 5 49.2
GG converged in 26 iterations.
i,lam= 6 38.61
GG converged in 48 iterations.
i,lam= 7 30.3
GG converged in 57 iterations.
i,lam= 8 23.78
GG converged in 62 iterations.
i,lam= 9 18.66
GG converged in 55 iterations.
i,lam= 10 14.64
GG converged in 63 iterations.
i,lam= 11 11.49
GG converged in 60 iterations.
i,lam= 12 9.02
GG converged in 119 iterations.
i,lam= 13 7.08
GG converged in 122 iterations.
i,lam= 14 5.55
GG converged in 139 iterations.
i,lam= 15 4.36
GG converged in 147 iterations.
i,lam= 16 3.42
GG converged in 200 iterations.
i,lam= 17 2.68
GG converged in 374 iterations.
i,lam= 18 2.11
GG converged in 291 iterations.
i,lam= 19 1.65
GG converged in 602 iterations.
i,lam= 20 1.3
GG converged in 657 iterations.
> fitcv=hierNet.cv(fit,x,y)
Fold 1 :i,lam= 1 129.72
GG converged in 1 iterations.
i,lam= 2 101.8
GG converged in 18 iterations.
i,lam= 3 79.89
GG converged in 25 iterations.
i,lam= 4 62.69
GG converged in 24 iterations.
i,lam= 5 49.2
GG converged in 24 iterations.
i,lam= 6 38.61
GG converged in 24 iterations.
i,lam= 7 30.3
GG converged in 64 iterations.
i,lam= 8 23.78
GG converged in 39 iterations.
i,lam= 9 18.66
GG converged in 60 iterations.
i,lam= 10 14.64
GG converged in 59 iterations.
i,lam= 11 11.49
GG converged in 65 iterations.
i,lam= 12 9.02
GG converged in 119 iterations.
i,lam= 13 7.08
GG converged in 122 iterations.
i,lam= 14 5.55
GG converged in 150 iterations.
i,lam= 15 4.36
GG converged in 222 iterations.
i,lam= 16 3.42
GG converged in 235 iterations.
i,lam= 17 2.68
GG converged in 400 iterations.
i,lam= 18 2.11
GG converged in 404 iterations.
i,lam= 19 1.65
GG converged in 678 iterations.
i,lam= 20 1.3
GG converged in 857 iterations.
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
hierNet
 --- call from context --- 
predict.hierNet(a, newx = x[folds[[ii]], ])
 --- call from argument --- 
if (class(object$bp) == "numeric") yhatt <- Compute.yhat.c(newx, 
    newzz, object) + object$my else {
    nlam <- ncol(object$bp)
    yhat <- matrix(NA, n, nlam)
    for (i in seq(nlam)) {
        bb <- list(bp = object$bp[, i], bn = object$bn[, i], 
            th = object$th[, , i], diagonal = object$diagonal)
        yhat[, i] <- Compute.yhat.c(newx, newzz, bb)
    }
    yhatt <- yhat + object$my
}
 --- R stacktrace ---
where 1: predict.hierNet(a, newx = x[folds[[ii]], ])
where 2: hierNet.cv(fit, x, y)

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (object, newx, newzz = NULL, ...) 
{
    n <- nrow(newx)
    if (is.null(object$sx)) 
        newx <- scale(newx, center = object$mx, scale = FALSE)
    else newx <- scale(newx, center = object$mx, scale = object$sx)
    if (is.null(newzz)) 
        newzz <- compute.interactions.c(newx, diagonal = object$diagonal)
    if (is.null(object$szz)) 
        newzz <- scale(newzz, center = object$mzz, scale = FALSE)
    else newzz <- scale(newzz, center = object$mzz, scale = object$szz)
    newzz <- as.numeric(newzz)
    newx <- as.numeric(newx)
    stopifnot(is.finite(newzz), is.finite(newx))
    if (class(object$bp) == "numeric") 
        yhatt <- Compute.yhat.c(newx, newzz, object) + object$my
    else {
        nlam <- ncol(object$bp)
        yhat <- matrix(NA, n, nlam)
        for (i in seq(nlam)) {
            bb <- list(bp = object$bp[, i], bn = object$bn[, 
                i], th = object$th[, , i], diagonal = object$diagonal)
            yhat[, i] <- Compute.yhat.c(newx, newzz, bb)
        }
        yhatt <- yhat + object$my
    }
    if (object$type == "logistic") {
        b0 <- object$b0
        if (is.matrix(yhatt)) 
            b0 <- matrix(b0, nrow = nrow(yhatt), ncol = ncol(yhatt), 
                byrow = T)
        yhatt <- b0 + yhatt
        pr <- 1/(1 + exp(-yhatt))
        return(list(prob = pr, yhat = 1 * (pr > 0.5)))
    }
    return(yhatt)
}
<bytecode: 0x3cce7d8>
<environment: namespace:hierNet>
 --- function search by body ---
Function predict.hierNet in namespace hierNet has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1