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

> ### Name: predict.spmeshed
> ### Title: Posterior predictive sampling for models based on MGPs
> ### Aliases: predict.spmeshed
> 
> ### ** 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(meshed)
> 
> set.seed(2021)
> 
> SS <- 12
> 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_full <- X %*% B + w + tausq^.5 * rnorm(n)
> 
> set_missing <- rbinom(n, 1, 0.1)
> 
> simdata <- data.frame(coords,
+                       y_full = y_full,
+                       w_latent = w) %>%
+   mutate(y_observed = ifelse(set_missing==1, NA, y_full))
> 
> # MCMC setup
> mcmc_keep <- 500
> mcmc_burn <- 100
> mcmc_thin <- 2
> 
> y <- simdata$y_observed
> ybar <- mean(y, na.rm=TRUE)
> 
> # training set
> y_in <- (y-ybar)[!is.na(y)]
> X_in <- X[!is.na(y),]
> coords_in <- coords[!is.na(y),]
> 
> # suppose we dont want to have gridded knots
> # i.e. we are fixing the MGP reference set at the observed locations
> # (this may be inefficient in big data settings)
> meshout <- spmeshed(y_in, X_in, coords_in,
+                     axis_partition=c(4,4),
+                     n_samples = mcmc_keep, 
+                     n_burn = mcmc_burn, 
+                     n_thin = mcmc_thin, 
+                     settings = list(forced_grid=FALSE, cache=FALSE),
+                     prior=list(phi=c(1,15)),
+                     verbose = 0,
+                     n_threads = 1)
Warning in spmeshed(y_in, X_in, coords_in, axis_partition = c(4, 4), n_samples = mcmc_keep,  :
  Data look not gridded: force a grid with settings$forced_grid=T.

 *** caught segfault ***
address 39494d6b, cause 'memory not mapped'