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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: brm
> ### Title: Fitting Binary Regression Models
> ### Aliases: brm
> 
> ### ** Examples
> 
> set.seed(0)
> n           = 100
> alpha.true  = c(0,-1)
> beta.true   = c(-0.5,1)
> gamma.true  = c(0.1,-0.5)
> params.true = list(alpha.true=alpha.true, beta.true=beta.true, 
+      gamma.true=gamma.true)
> v.1         = rep(1,n)       # intercept term
> v.2         = runif(n,-2,2) 
> v           = cbind(v.1,v.2)
> pscore.true = exp(v %*% gamma.true) / (1+exp(v %*% gamma.true))
> p0p1.true   = t(mapply(getProbScalarRR,v %*% alpha.true,v %*% beta.true)) 
> x           = mapply(rbinom,rep(1,n),rep(1,n),pscore.true)  
> pA.true       = p0p1.true[,1]
> pA.true[x==1] = p0p1.true[x==1,2]
> y = mapply(rbinom,rep(1,n),rep(1,n),pA.true)
> 
> fit.mle = brm(y,x,v,v,'RR','MLE',v,TRUE)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
brm
 --- call from context --- 
brm(y, x, v, v, "RR", "MLE", v, TRUE)
 --- call from argument --- 
if (class(va) == "formula") va = stats::model.matrix(va)
 --- R stacktrace ---
where 1: brm(y, x, v, v, "RR", "MLE", v, TRUE)

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (y, x, va, vb = NULL, param, est.method = "MLE", vc = NULL, 
    optimal = TRUE, weights = NULL, subset = NULL, max.step = 1000, 
    thres = 1e-06, alpha.start = NULL, beta.start = NULL, message = FALSE) 
{
    if (is.null(vb)) 
        vb = va
    if (is.null(vc)) 
        vc = va
    if (class(va) == "formula") 
        va = stats::model.matrix(va)
    if (class(vb) == "formula") 
        vb = stats::model.matrix(vb)
    if (class(vc) == "formula") 
        vc = stats::model.matrix(vc)
    if (is.null(weights)) 
        weights = rep(1, length(y))
    if (is.null(subset)) 
        subset = 1:length(y)
    ValidCheck(param, y, x, va, vb, vc, weights, subset, est.method, 
        optimal, max.step, thres, alpha.start, beta.start)
    data = cbind(y, x, va, vb, vc, weights)[subset, ]
    subset = subset[rowSums(is.na(data)) == 0]
    y = y[subset]
    x = x[subset]
    va = va[subset, ]
    vb = vb[subset, ]
    vc = vc[subset, ]
    weights = weights[subset]
    pa = dim(va)[2]
    pb = dim(vb)[2]
    if (est.method == "MLE") {
        sol = MLEst(param, y, x, va, vb, weights, max.step, thres, 
            alpha.start, beta.start, pa, pb)
    }
    if (est.method == "DR") {
        if (param == "OR") {
            cat("No doubly robust estimation methods for OR (with propensity score models) are available. Please refer to Tchetgen Tchetgen et al. (2010) for an alternative doubly robust estimation method. \n")
            return()
        }
        if (is.null(alpha.start) | is.null(beta.start)) {
            sol = MLEst(param, y, x, va, vb, weights, max.step, 
                thres, alpha.start, beta.start, pa, pb)
            alpha.ml = sol$point.est[1:pa]
            beta.ml = sol$point.est[(pa + 1):(pa + pb)]
            beta.cov = sol$cov[(pa + 1):(pa + pb), (pa + 1):(pa + 
                pb)]
            alpha.start = alpha.ml
        }
        else {
            alpha.ml = alpha.start
            beta.ml = beta.start
            beta.cov = matrix(NA, pb, pb)
        }
        gamma.fit = stats::glm(x ~ vc - 1, weight = weights, 
            family = "binomial")
        gamma = gamma.fit$coefficients
        gamma.cov = summary(gamma.fit)$cov.unscaled
        sol = DREst(param, y, x, va, vb, vc, alpha.ml, beta.ml, 
            gamma, optimal, weights, max.step, thres, alpha.start, 
            beta.cov, gamma.cov, message)
    }
    return(sol)
}
<bytecode: 0x2bed090>
<environment: namespace:brm>
 --- function search by body ---
Function brm in namespace brm has this body.
 ----------- END OF FAILURE REPORT -------------- 
Error in if (class(va) == "formula") va = stats::model.matrix(va) : 
  the condition has length > 1
Calls: brm
Execution halted