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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: abart
> ### Title: AFT BART for time-to-event outcomes
> ### Aliases: abart mc.abart
> ### Keywords: nonparametric tree regression nonlinear
> 
> ### ** Examples
> 
> 
> N = 1000
> P = 5       #number of covariates
> M = 8
> 
> set.seed(12)
> x.train=matrix(runif(N*P, -2, 2), N, P)
> mu = x.train[ , 1]^3
> y=rnorm(N, mu)
> offset=mean(y)
> T=exp(y)
> C=rexp(N, 0.05)
> delta=(T<C)*1
> table(delta)/N
delta
    0     1 
0.194 0.806 
> times=(T*delta+C*(1-delta))
> 
> ##test BART with token run to ensure installation works
> set.seed(99)
> post1 = abart(x.train, times, delta, nskip=5, ndpost=10)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
BART
 --- call from context --- 
bartModelMatrix(x.train, numcut, usequants = usequants, xinfo = xinfo, 
    rm.const = rm.const)
 --- call from argument --- 
if (X.class == "factor") {
    X.class = "data.frame"
    X = data.frame(X = X)
}
 --- R stacktrace ---
where 1: bartModelMatrix(x.train, numcut, usequants = usequants, xinfo = xinfo, 
    rm.const = rm.const)
where 2: abart(x.train, times, delta, nskip = 5, ndpost = 10)

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (X, numcut = 0L, usequants = FALSE, type = 7, rm.const = FALSE, 
    cont = FALSE, xinfo = NULL) 
{
    X.class = class(X)
    if (X.class == "factor") {
        X.class = "data.frame"
        X = data.frame(X = X)
    }
    grp = NULL
    if (X.class == "data.frame") {
        p = dim(X)[2]
        xnm = names(X)
        for (i in 1:p) {
            if (is.factor(X[[i]])) {
                Xtemp = class.ind(X[[i]])
                colnames(Xtemp) = paste(xnm[i], 1:ncol(Xtemp), 
                  sep = "")
                X[[i]] = Xtemp
                grp = c(grp, rep(i, ncol(Xtemp)))
            }
            else {
                X[[i]] = cbind(X[[i]])
                colnames(X[[i]]) = xnm[i]
                grp = c(grp, i)
            }
        }
        Xtemp = cbind(X[[1]])
        if (p > 1) 
            for (i in 2:p) Xtemp = cbind(Xtemp, X[[i]])
        X = Xtemp
    }
    else if (X.class == "numeric" | X.class == "integer") {
        X = cbind(as.numeric(X))
        grp = 1
    }
    else if (X.class == "NULL") 
        return(X)
    else if (X.class != "matrix") 
        stop("Expecting either a factor, a vector, a matrix or a data.frame")
    N <- nrow(X)
    p <- ncol(X)
    xinfo. <- matrix(nrow = p, ncol = numcut)
    nc <- numcut
    rm.vars <- c()
    if (N > 0 & p > 0 & (rm.const | numcut[1] > 0)) {
        for (j in 1:p) {
            X.class <- class(X[1, j])
            if (X.class == "numeric" | X.class == "integer") {
                xs <- unique(sort(X[, j]))
                k <- length(xs)
                nc[j] <- numcut
                if (k %in% 0:1) {
                  rm.vars <- c(rm.vars, -j)
                  nc[j] <- 1
                  if (k == 0) 
                    xs <- NA
                }
                else if (cont) 
                  xs <- seq(xs[1], xs[k], length.out = numcut + 
                    2)[-c(1, numcut + 2)]
                else if (k < numcut) {
                  xs <- 0.5 * (xs[1:(k - 1)] + xs[2:k])
                  nc[j] <- k - 1
                }
                else if (usequants) {
                  xs <- quantile(X[, j], type = type, probs = (0:(numcut + 
                    1))/(numcut + 1))[-c(1, numcut + 2)]
                  names(xs) <- NULL
                }
                else xs <- seq(xs[1], xs[k], length.out = numcut + 
                  2)[-c(1, numcut + 2)]
            }
            else stop(paste0("Variables of type ", X.class, " are not supported"))
            xinfo.[j, 1:nc[j]] <- xs
        }
    }
    X <- data.matrix(X)
    if (length(xinfo) > 0) {
        if (is.list(xinfo)) 
            for (j in 1:p) xinfo.[j, 1:length(xinfo[[j]])] <- xinfo[[j]]
        else if (is.matrix(xinfo)) 
            xinfo. <- xinfo
        else stop("Only a list or a matrix can be provided for xinfo")
        for (j in 1:p) nc[j] <- sum(!is.na(xinfo.[j, ]))
    }
    xinfo <- xinfo.
    if (rm.const & length(rm.vars) > 0) {
        X <- X[, rm.vars]
        nc <- nc[rm.vars]
        xinfo <- xinfo[rm.vars, ]
    }
    else if (length(rm.vars) == 0) 
        rm.vars <- 1:p
    dimnames(xinfo) <- list(dimnames(X)[[2]], NULL)
    if (numcut == 0) 
        return(X)
    else return(list(X = X, numcut = as.integer(nc), rm.const = rm.vars, 
        xinfo = xinfo, grp = grp))
}
<bytecode: 0x6648648>
<environment: namespace:BART>
 --- function search by body ---
Function bartModelMatrix in namespace BART has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1