Running ‘RFsimulate.R’ [24s/25s]
  Running ‘krige.R’ [20s/21s]
  Running ‘lgcp.R’ [29s/30s]
  Running ‘lgm.R’ [55s/57s]
  Running ‘lgmRaster.R’ [202s/205s]
  Running ‘likfitLgm.R’ [18s/19s]
  Running ‘matern.R’ [15s/15s]
  Running ‘maternGmrfPrec.R’ [18s/18s]
  Running ‘profLlgm.R’ [29s/24s]
  Running ‘simLgcp.R’ [19s/20s]
  Running ‘stackRasterList.R’ [14s/14s]
Running the tests in ‘tests/simLgcp.R’ failed.
Complete output:
  > 
  > if(requireNamespace("INLA", quietly=TRUE) ) {
  +   INLA::inla.setOption(num.threads=2)
  +   # not all versions of INLA support blas.num.threads
  +   try(INLA::inla.setOption(blas.num.threads=2), silent=TRUE)
  + } 
  > 
  > library('geostatsp')
  Loading required package: Matrix
  Loading required package: terra
  terra 1.7.55
  > 
  > # exclude this line to use the RandomFields package
  > options(useRandomFields = FALSE)
  > 
  > mymodel = c(mean=-1.5, variance=1, 
  + 				range=2, shape=2)
  > 
  > myraster = rast(nrows=15,ncols=15,xmin=0,xmax=10,ymin=0,ymax=10)
  > 
  > # some covariates, deliberately with a different resolution than myraster
  > covA = covB = myoffset = rast(ext(myraster), 10, 10)
  > values(covA) = as.vector(matrix(1:10, 10, 10))
  > values(covB) = as.vector(matrix(1:10, 10, 10, byrow=TRUE))
  > values(myoffset) = round(seq(-1, 1, len=ncell(myoffset)))
  > 
  > myCovariate = list(a=covA, b=covB, offsetFooBar = myoffset)
  > 
  > set.seed(0)
  > myLgcp=simLgcp(mymodel, myCovariate, 
  +     betas=c(a=-0.1, b=0.25), 
  + 	offset='offsetFooBar',
  + 	rasterTemplate=myraster)
  > 
  > if(requireNamespace("INLA", quietly=TRUE)) {
  + res = lgcp(data=myLgcp$events, 
  + 		formula = ~ a + b + offset(offsetFooBar),
  + 		grid=squareRaster(myoffset, 15), 
  + 		covariates=myCovariate,
  + 		prior=list(sd=0.2, range=0.4))
  + 
  + res$parameters$summary[,c(1,3,5)]
  + 
  + lgcpRoc =  spatialRoc(
  +   fit=res, 
  + 	rr=c(2,3), 
  + 	truth=myLgcp, 
  + 	random=FALSE)
  + 
  + head(lgcpRoc)
  + 
  + plot(lgcpRoc[,'onemspec'] , 
  + 	lgcpRoc[,'2'], 
  + 	type='o', 
  + 	xlim=c(0,1), ylim=c(0,1),
  + 	ylab='sensitivity', xlab='1-specificity'
  + )
  + 
  + }
  Error in validObject(.Object) : 
    invalid class "dsparseModelMatrix" object: superclass "xMatrix" not defined in the environment of the object's class
  
   *** inla.core.safe:  inla.program has crashed: rerun to get better initial values. try=1/1 
  Error in validObject(.Object) : 
    invalid class "dsparseModelMatrix" object: superclass "xMatrix" not defined in the environment of the object's class
  Error in inla.core.safe(formula = formula, family = family, contrasts = contrasts,  : 
    *** Failed to get good enough initial values. Maybe it is due to something else.
  Error in fit[[1]]$data : $ operator is invalid for atomic vectors
  Calls: spatialRoc -> spatialRocPolyTemplate
  Execution halted