Running examples in ‘treatSens-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: treatSens.BART
> ### Title: Dual-Parameter Sensitivity Analysis Using BART
> ### Aliases: treatSens.BART
> 
> ### ** Examples
> 
> N <- 250                      # number of observations
> 
> zetay <- 0.5                  # coefficient on U in the outcome model
> zetaz <- 0.5                  # coefficient on U in the treatment model
> betaz <- c(0.75, -0.5,  0.25) # coefficients of X in the treatment model
> betay <- c(0.5,   1.0, -1.5)  # coefficients of X in the outcome model
> tau   <- 0.25                 # treatment effect
> 
> set.seed(725)
> X <- matrix(rnorm(3 * N), N)  # covariates
> 
> U  <- rbinom(N, 1, 0.5)                        # unmeasured confounder
> ps <- pnorm(X %*% betaz + zetaz * (U - 0.5)) # propensity score
> Z  <- rbinom(N, 1, ps)                         # treatment variable
> epsilon <- rnorm(N, 0.0, 2.0)                  # error term
> 
> Y0 <- X %*% betay + zetay * (U - 0.5) + epsilon       # potential outcome(Z=0)
> Y1 <- X %*% betay + zetay * (U - 0.5) + tau + epsilon # potential outcome(Z=1)
> Y  <- Y0 * (1 - Z) + Y1 * Z                             # realization of potential outcome
> 
> # sensitivity analysis
> out.bin <- treatSens.BART(Y ~ Z + X, nsim = 3, nthin = 2, nburn = 0,
+                           spy.range = c(0, 4), spz.range = c(-2 , 2), grid.dim = c(5, 3),
+                           standardize = FALSE, verbose = TRUE)
Warning in model.matrix.default(mt, mf, contrasts) :
  non-list contrasts argument ignored
Warning in model.matrix.default(mt, mf, contrasts) :
  non-list contrasts argument ignored
Binary U with binomial distribution is assumed.
"ATE" option is selected. Sensitivity analysis is performed with the default Weights for the average treatment effect.
Weight trimming is applied.  The maximum size of weights is set to 25 , which is 10 % of the size of the inferential group.
Computing final grid...

 *** caught segfault ***
address (nil), cause 'memory not mapped'

 *** caught segfault ***
address (nil), cause 'memory not mapped'
Error in treatSens:::cibart(c(, -3.70603922044676, 2.496600707264, , -2.92570861620553,  : 
  Value of SET_STRING_ELT() must be a 'CHARSXP' not a 'NULL'
Calls: treatSens.BART -> eval -> eval -> <Anonymous>
Execution halted
Warning: stack imbalance in 'lapply', 50 then 49
Warning: stack imbalance in 'vapply', 38 then 36
Warning: stack imbalance in '<-', 45 then 48
Warning: stack imbalance in '$', 50 then 53
Warning: stack imbalance in '<-', 48 then 51

 *** caught segfault ***
address (nil), cause 'memory not mapped'
Warning: stack imbalance in '!=', 61 then 60

Traceback:
 1: readRDS(mapfile)
 2: lazyLoadDBexec(filebase, fun, filter)
 3: lazyLoad(dbbase, ns, filter = function(n) n != ".__NAMESPACE__.")
 4: eval(quote({    info <- loadingNamespaceInfo()    pkg <- info$pkgname    ns <- .getNamespace(as.name(pkg))    if (is.null(ns)) stop("cannot find namespace environment for ",         pkg, domain = NA)    dbbase <- file.path(info$libname, pkg, "R", pkg)    lazyLoad(dbbase, ns, filter = function(n) n != ".__NAMESPACE__.")}), new.env())
 5: eval(quote({    info <- loadingNamespaceInfo()    pkg <- info$pkgname    ns <- .getNamespace(as.name(pkg))    if (is.null(ns)) stop("cannot find namespace environment for ",         pkg, domain = NA)    dbbase <- file.path(info$libname, pkg, "R", pkg)    lazyLoad(dbbase, ns, filter = function(n) n != ".__NAMESPACE__.")}), new.env())
 6: eval(expr, p)
 7: eval(expr, p)
 8: eval.parent(substitute(eval(quote(expr), envir)))
 9: local({    info <- loadingNamespaceInfo()    pkg <- info$pkgname    ns <- .getNamespace(as.name(pkg))    if (is.null(ns))         stop("cannot find namespace environment for ", pkg, domain = NA)    dbbase <- file.path(info$libname, pkg, "R", pkg)    lazyLoad(dbbase, ns, filter = function(n) n != ".__NAMESPACE__.")})
10: eval(exprs[i], envir)
11: eval(exprs[i], envir)
12: sys.source(codeFile, env, keep.source = keep.source, keep.parse.data = keep.parse.data)
13: doTryCatch(return(expr), name, parentenv, handler)
14: tryCatchOne(expr, names, parentenv, handlers[[1L]])
15: tryCatchList(expr, classes, parentenv, handlers)
16: 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))})
17: try(sys.source(codeFile, env, keep.source = keep.source, keep.parse.data = keep.parse.data))
18: loadNamespace(name)
19: getNamespace(ns)
20: asNamespace(ns)
21: getExportedValue(pkg, name)
22: tools::SIGKILL
23: cleanup(kill = tools::SIGKILL, detach = TRUE, shutdown = TRUE)
24: (function (e) cleanup(kill = tools::SIGKILL, detach = TRUE, shutdown = TRUE))(<environment>)
An irrecoverable exception occurred. R is aborting now ...

 *** caught segfault ***

 *** caught segfault ***
address (nil), cause 'memory not mapped'

 *** caught segfault ***
address (nil), cause 'memory not mapped'

 *** caught segfault ***
address (nil), cause 'memory not mapped'

 *** caught segfault ***
address (nil), cause 'memory not mapped'

 *** caught segfault ***
address (nil), cause 'memory not mapped'

 *** caught segfault ***
address (nil), cause 'memory not mapped'

 *** caught segfault ***
address (nil), cause 'memory not mapped'

 *** caught segfault ***
address (nil), cause 'memory not mapped'
address (nil), cause 'memory not mapped'

 *** caught segfault ***
address (nil), cause 'memory not mapped'

 *** caught segfault ***

 *** caught segfault ***
address (nil), cause 'memory not mapped'
address (nil), cause 'memory not mapped'
Warning: stack imbalance in 'options', 30 then 28
Segmentation fault