Error(s) in re-building vignettes:
--- re-building ‘iptw.rnw’ using Sweave
Loading required package: gbm
Loaded gbm 2.1.5
Loading required package: survey
Loading required package: grid
Loading required package: Matrix
Loading required package: survival

Attaching package: ‘survey’

The following object is masked from ‘package:graphics’:

    dotchart

Loading required package: xtable
Loading required package: lattice
Loading required package: latticeExtra
--- finished re-building ‘iptw.rnw’

--- re-building ‘mnps.rnw’ using Sweave
Loading required package: gbm
Loaded gbm 2.1.5
Loading required package: survey
Loading required package: grid
Loading required package: Matrix
Loading required package: survival

Attaching package: ‘survey’

The following object is masked from ‘package:graphics’:

    dotchart

Loading required package: xtable
Loading required package: lattice
Loading required package: latticeExtra
--- finished re-building ‘mnps.rnw’

--- re-building ‘twang.rnw’ using Sweave
Loading required package: gbm
Loaded gbm 2.1.5
Loading required package: survey
Loading required package: grid
Loading required package: Matrix
Loading required package: survival

Attaching package: ‘survey’

The following object is masked from ‘package:graphics’:

    dotchart

Loading required package: xtable
Loading required package: lattice
Loading required package: latticeExtra
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
twang
 --- call from context --- 
dx.wts(x = lalonde$w.logit, data = lalonde, vars = c("age", "educ", 
    "black", "hispan", "nodegree", "married", "re74", "re75"), 
    treat.var = "treat", perm.test.iters = 0, estimand = "ATT")
 --- call from argument --- 
if (class(x) != "ps") {
    desc <- vector("list", ncol(w))
    names(desc) <- colnames(w)
}
 --- R stacktrace ---
where 1: dx.wts(x = lalonde$w.logit, data = lalonde, vars = c("age", "educ", 
    "black", "hispan", "nodegree", "married", "re74", "re75"), 
    treat.var = "treat", perm.test.iters = 0, estimand = "ATT")
where 2: eval(expr, .GlobalEnv)
where 3: eval(expr, .GlobalEnv)
where 4: withVisible(eval(expr, .GlobalEnv))
where 5: doTryCatch(return(expr), name, parentenv, handler)
where 6: tryCatchOne(expr, names, parentenv, handlers[[1L]])
where 7: tryCatchList(expr, classes, parentenv, handlers)
where 8: tryCatch(expr, error = function(e) {
    call <- conditionCall(e)
    if (!is.null(call)) {
        if (identical(call[[1L]], quote(doTryCatch))) 
            call <- sys.call(-4L)
        dcall <- deparse(call)[1L]
        prefix <- paste("Error in", dcall, ": ")
        LONG <- 75L
        sm <- strsplit(conditionMessage(e), "\n")[[1L]]
        w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w")
        if (is.na(w)) 
            w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L], 
                type = "b")
        if (w > LONG) 
            prefix <- paste0(prefix, "\n  ")
    }
    else prefix <- "Error : "
    msg <- paste0(prefix, conditionMessage(e), "\n")
    .Internal(seterrmessage(msg[1L]))
    if (!silent && isTRUE(getOption("show.error.messages"))) {
        cat(msg, file = outFile)
        .Internal(printDeferredWarnings())
    }
    invisible(structure(msg, class = "try-error", condition = e))
})
where 9: try(withVisible(eval(expr, .GlobalEnv)), silent = TRUE)
where 10: evalFunc(ce, options)
where 11: tryCatchList(expr, classes, parentenv, handlers)
where 12: tryCatch(evalFunc(ce, options), finally = {
    cat("\n")
    sink()
})
where 13: driver$runcode(drobj, chunk, chunkopts)
where 14: utils::Sweave(...)
where 15: engine$weave(file, quiet = quiet, encoding = enc)
where 16: doTryCatch(return(expr), name, parentenv, handler)
where 17: tryCatchOne(expr, names, parentenv, handlers[[1L]])
where 18: tryCatchList(expr, classes, parentenv, handlers)
where 19: tryCatch({
    engine$weave(file, quiet = quiet, encoding = enc)
    setwd(startdir)
    output <- find_vignette_product(name, by = "weave", engine = engine)
    if (!have.makefile && vignette_is_tex(output)) {
        texi2pdf(file = output, clean = FALSE, quiet = quiet)
        output <- find_vignette_product(name, by = "texi2pdf", 
            engine = engine)
    }
}, error = function(e) {
    OK <<- FALSE
    message(gettextf("Error: processing vignette '%s' failed with diagnostics:\n%s", 
        file, conditionMessage(e)))
})
where 20: tools:::.buildOneVignette("twang.rnw", "/data/gannet/ripley/R/packages/tests-clang/twang.Rcheck/vign_test/twang", 
    TRUE, FALSE, "twang", "", "/tmp/RtmpeokSAt/working_dir/RtmpvA2xf8/file50561912857c.rds")

 --- value of length: 2 type: logical ---
[1] TRUE TRUE
 --- function from context --- 
function (x, data, estimand, vars = NULL, treat.var, x.as.weights = TRUE, 
    sampw = NULL, perm.test.iters = 0) 
{
    if (is.null(estimand)) 
        stop("'estimand' must be specified")
    if (!(estimand %in% c("ATE", "ATT"))) 
        stop("'estimand' must be either 'ATT' or 'ATE'")
    if (class(x) != "ps") {
        if (!is.vector(x) && !is.matrix(x) && !is.data.frame(x)) 
            stop("x must be a ps object, a vector, a matrix, or a data frame")
        if (any(x < 0)) 
            stop("x has negative values")
        if (is.null(dim(x))) 
            x <- matrix(x, ncol = 1)
        if (nrow(x) != nrow(data)) 
            stop("length(x) != nrow(data)")
        if (x.as.weights) {
            if (is.data.frame(x)) 
                x <- as.matrix(x)
            if (estimand == "ATT") {
                w <- x
                p.s <- x/(1 + x)
            }
            if (estimand == "ATE") {
                w <- x
                p.s <- x
                p.s[data[, treat.var] == 0] <- (w[data[, treat.var] == 
                  0] - 1)/w[data[, treat.var] == 0]
                p.s[data[, treat.var] == 1] <- 1/w[data[, treat.var] == 
                  1]
            }
        }
        else {
            if (any(x > 1) && !x.as.weights) 
                stop("x has values greater than 1. With x.as.weights=FALSE x should be a vector of propensity scores.")
            w <- matrix(1, nrow = nrow(x), ncol = ncol(x))
            i <- data[, treat.var] == 0
            x <- data.matrix(x)
            if (estimand == "ATT") {
                w[i, ] <- x[i, ]/(1 - x[i, ])
                p.s <- x
            }
            if (estimand == "ATE") {
                w[i, ] <- 1/(1 - x[i, ])
                w[!i, ] <- 1/x[!i, ]
                p.s <- x
            }
        }
        if (any(is.infinite(w))) 
            stop("Some propensity weights are infinite.")
    }
    else {
        if (!is.null(sampw)) 
            warning("Sampling weights given when x is a ps object. The sampling weights should be utilized when running ps and are probably not needed here as well and the results may not be correct.")
        if (estimand != x$estimand) 
            warning("A different estimand was specified when fitting this ps object.  Results for\n      the original estimand are being returned.")
        p.s <- x$ps
        w <- x$w
        desc <- x$desc
        data <- x$data
        treat.var <- x$treat.var
        estimand <- x$estimand
    }
    if (!all(w[, 1] == 1)) {
        w <- cbind(unw = rep(1, nrow(w)), w)
        p.s <- cbind(unw = rep(0.5, nrow(p.s)), p.s)
    }
    if (!is.null(sampw)) 
        w <- w * sampw
    if (is.null(vars)) 
        vars <- names(data)[names(data) != treat.var]
    summary.tab <- NULL
    n.tp <- ifelse(class(x) == "ps", length(x$desc), ncol(w))
    if (class(x) != "ps") {
        desc <- vector("list", ncol(w))
        names(desc) <- colnames(w)
    }
    for (i.tp in 1:n.tp) {
        if ((class(x) == "ps") & is.null(vars)) {
            desc.temp <- x$desc[[i.tp]]
            iter <- desc.temp$n.trees
            tp <- names(x$desc)[i.tp]
        }
        else {
            desc.temp <- desc.wts(data, w = w[, i.tp], sampw = rep(1, 
                nrow(w)), vars = vars, treat.var = treat.var, 
                perm.test.iters = perm.test.iters, verbose = TRUE, 
                estimand = estimand)
            iter <- NA
            tp <- colnames(w)[i.tp]
            desc[[i.tp]] <- desc.temp
        }
        if (is.null(tp)) 
            tp <- "unnamed"
        summary.tab <- rbind(summary.tab, with(desc.temp, data.frame(type = tp, 
            n.treat = n.treat, n.ctrl = n.ctrl, ess.treat = ess.treat, 
            ess.ctrl = ess.ctrl, max.es = max.es, mean.es = mean.es, 
            max.ks = max.ks, mean.ks = mean.ks, iter = iter)))
    }
    rownames(summary.tab) <- 1:nrow(summary.tab)
    result <- list(treat = data[, treat.var], desc = desc, summary.tab = summary.tab, 
        ps = as.matrix(p.s[, -1]), w = as.matrix(w[, -1]), datestamp = date(), 
        parameters = match.call(), varNames = vars)
    class(result) <- "dxwts"
    return(result)
}
<bytecode: 0xb29bdc0>
<environment: namespace:twang>
 --- function search by body ---
Function dx.wts in namespace twang has this body.
 ----------- END OF FAILURE REPORT -------------- 

Error: processing vignette 'twang.rnw' failed with diagnostics:
 chunk 28 
Error in if (class(x) != "ps") { : the condition has length > 1

--- failed re-building ‘twang.rnw’

SUMMARY: processing the following file failed:
  ‘twang.rnw’

Error: Vignette re-building failed.
Execution halted