CRAN Package Check Results for Package brm

Last updated on 2020-01-20 01:50:16 CET.

Flavor Version Tinstall Tcheck Ttotal Status Flags
r-devel-linux-x86_64-debian-clang 1.0 3.56 22.81 26.37 ERROR
r-devel-linux-x86_64-debian-gcc 1.0 2.85 20.69 23.54 OK
r-devel-linux-x86_64-fedora-clang 1.0 37.32 OK
r-devel-linux-x86_64-fedora-gcc 1.0 35.63 OK
r-devel-windows-ix86+x86_64 1.0 11.00 52.00 63.00 OK
r-devel-windows-ix86+x86_64-gcc8 1.0 6.00 42.00 48.00 OK
r-patched-linux-x86_64 1.0 3.01 25.26 28.27 OK
r-patched-solaris-x86 1.0 48.10 OK
r-release-linux-x86_64 1.0 2.97 25.22 28.19 OK
r-release-windows-ix86+x86_64 1.0 8.00 36.00 44.00 OK
r-release-osx-x86_64 1.0 OK
r-oldrel-windows-ix86+x86_64 1.0 3.00 33.00 36.00 OK
r-oldrel-osx-x86_64 1.0 OK

Check Details

Version: 1.0
Check: examples
Result: ERROR
    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: 0x2ba4e18>
    <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
Flavor: r-devel-linux-x86_64-debian-clang