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

> ### Name: spamtree
> ### Title: Bayesian Spatial Multivariate Tree GP Regression
> ### Aliases: spamtree
> 
> ### ** Examples
> 
> 
> # toy example with tiny dataset and short MCMC
> # on a univariate outcome
> 
> library(magrittr)
> library(dplyr)

Attaching package: ‘dplyr’

The following objects are masked from ‘package:stats’:

    filter, lag

The following objects are masked from ‘package:base’:

    intersect, setdiff, setequal, union

> library(ggplot2)
> library(spamtree)
> 
> set.seed(2021)
> 
> SS <- 15 
> n <- SS^2 # total n. locations, including missing ones
> 
> coords <- data.frame(Var1=runif(n), Var2=runif(n)) %>%
+   as.matrix()
> 
> # generate data
> sigmasq <- 2.3
> phi <- 6
> tausq <- .1
> B <- c(-1,.5,1)
> 
> CC <- sigmasq * exp(-phi * as.matrix(dist(coords)))
> LC <- t(chol(CC))
> w <- LC %*% rnorm(n)
> p <- length(B)
> X <- rnorm(n * p) %>% matrix(ncol=p)
> y <- X %*% B + w + tausq^.5 * rnorm(n)
> 
> set_missing <- rbinom(n, 1, 0.1)
> 
> simdata <- data.frame(coords,
+                       y_full = y,
+                       w_latent = w) %>%
+   mutate(y_observed = ifelse(set_missing==1, NA, y_full))
> 
> # MCMC setup
> mcmc_keep <- 300
> mcmc_burn <- 300
> mcmc_thin <- 1
> 
> ybar <- mean(y, na.rm=TRUE)
> 
> # fit spamtree with defaults
> spamtree_done <- spamtree(y - ybar, X, coords, 
+           mcmc = list(keep=mcmc_keep, burn=mcmc_burn, thin=mcmc_thin), 
+           num_threads = 1)

 *** caught segfault ***
address 0, cause 'memory not mapped'

Traceback:
 1: spamtree_mv_mcmc(y, x, Z, cx_all, sort_mv_id, blocking, gix_block,     res_is_ref, parents, children, limited_tree, block_names,     block_groups, indexing, set_unif_bounds, start_w, start_theta,     start_beta, start_tausq, mcmc_mh_sd, mcmc_keep, mcmc_burn,     mcmc_thin, num_threads, use_alg, mcmc_adaptive, main_verbose,     mcmc_verbose, mcmc_debug, mcmc_printall, sample_beta, sample_tausq,     sample_theta, sample_w, sample_predicts)
 2: system.time({    results <- spamtree_mv_mcmc(y, x, Z, cx_all, sort_mv_id,         blocking, gix_block, res_is_ref, parents, children, limited_tree,         block_names, block_groups, indexing, set_unif_bounds,         start_w, start_theta, start_beta, start_tausq, mcmc_mh_sd,         mcmc_keep, mcmc_burn, mcmc_thin, num_threads, use_alg,         mcmc_adaptive, main_verbose, mcmc_verbose, mcmc_debug,         mcmc_printall, sample_beta, sample_tausq, sample_theta,         sample_w, sample_predicts)})
 3: spamtree(y - ybar, X, coords, mcmc = list(keep = mcmc_keep, burn = mcmc_burn,     thin = mcmc_thin), num_threads = 1)
An irrecoverable exception occurred. R is aborting now ...