Running 'RFsimulate.R' [11s]
  Running 'krige.R' [10s]
  Running 'lgcp.R' [9s]
  Running 'lgm.R' [33s]
  Running 'lgmRaster.R' [74s]
  Running 'likfitLgm.R' [11s]
  Running 'matern.R' [9s]
  Running 'maternGmrfPrec.R' [12s]
  Running 'profLlgm.R' [13s]
  Running 'simLgcp.R' [7s]
  Running 'stackRasterList.R' [7s]
Running the tests in 'tests/matern.R' failed.
Complete output:
  > library("geostatsp")
  Loading required package: Matrix
  Loading required package: terra
  terra 1.8.86
  > 
  > param = c(range=1, shape=1.5,	anisoRatio=2, anisoAngleDegrees=-25)
  > 
  > matern(c(0, 0.001, 100000), param=param)
  [1] 1.000000 0.999994 0.000000
  attr(,"param")
              range             shape          variance            nugget 
          1.0000000         1.5000000         1.0000000         0.0000000 
         anisoRatio anisoAngleRadians anisoAngleDegrees 
          2.0000000        -0.4363323       -25.0000000 
  > 
  > #x=c(0, 0.001, 100000);param=c(param, variance=1)
  > 
  > #resultFull = .C("matern", as.double(x), as.integer(length(x)),
  > #		as.double(param["range"]), as.double(param["shape"]),
  > #		as.double(param["variance"]))
  > 
  > 
  > # example with raster
  > myraster = rast(nrows=40,ncols=60,xmin=-3,xmax=3,ymin=-2,ymax=2)
  > 
  > # plot correlation of each cell with the origin
  > myMatern = matern(myraster, y=c(0,0), param=param)
  > myMatern[1:3,1:3]
          lyr.1
  1 0.002385719
  2 0.003084067
  3 0.003973211
  4 0.002349589
  5 0.003047536
  6 0.003940191
  7 0.002302637
  8 0.002996124
  9 0.003886871
  >  
  > 
  > 
  > bob = function(x) {
  + thepar = attributes(x)$param
  + pdf(tempfile("matern", tmpdir=".", fileext=".pdf"))
  + plot(x, main=
  + 				paste(
  + 				paste(names(thepar), thepar, sep="="),
  + 				collapse=", "),cex.main=0.5
  + )
  + dev.off()
  + }
  > 
  > bob(myMatern)
  null device 
            1 
  > 
  > 
  > bob(matern(myraster, y=c(1,-0.5), 
  + 				param =	c(range=1, shape=1.5,	anisoRatio=2, anisoAngleDegrees=25)			
  + 						)
  + )
  null device 
            1 
  > 
  > bob(matern(myraster,y= c(0,0), 
  + 				param =	c(range=1, shape=25.1,	anisoRatio=2, anisoAngleDegrees=-25)			
  + 		)
  + )
  null device 
            1 
  > 
  > bob(matern(myraster,y= c(0,0), 
  + 				param =	c(range=0, shape=1.5,	anisoRatio=2, anisoAngleDegrees=-25)			
  + 		)
  + )
  null device 
            1 
  > 
  > bob(matern(myraster, y=c(0,0), 
  + 				param =	c(range=100000, shape=1.5,	anisoRatio=2, anisoAngleDegrees=-25)			
  + 		)
  + )
  null device 
            1 
  > 
  > 
  > 				
  > 				
  > 
  > # correlation matrix for all cells with each other
  > myraster = rast(nrows=4,ncols=6,xmin=-3,xmax=3,ymin=-2,ymax=2)
  > myMatern = matern(myraster, param=c(range=0, shape=2))
  > 
  > dim(myMatern)
  [1] 24 24
  > myMatern[1:3,1:3]
  3 x 3 Matrix of class "dsyMatrix"
       [,1] [,2] [,3]
  [1,]    1    0    0
  [2,]    0    1    0
  [3,]    0    0    1
  > 
  > param = c(range=0.2, shape=1.5)
  > set.seed(0)
  > 
  > mypoints = vect(cbind(runif(10), runif(10)), 
  + 		crs = "epsg:2000",
  + 		atts=data.frame(id=1:10))
  Warning messages:
  1: PROJ: proj_create_from_database: Cannot find proj.db (GDAL error 1) 
  2: [crs<-] Cannot set SRS to vector: empty srs 
  > 
  > myDist = forceSymmetric(as.matrix(distance(mypoints)))
  Error in h(simpleError(msg, call)) : 
    error in evaluating the argument 'x' in selecting a method for function 'forceSymmetric': error in evaluating the argument 'x' in selecting a method for function 'as.matrix': [distance] crs not defined
  Calls: forceSymmetric ... distance -> distance -> .local -> messages -> error
  Execution halted
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.8.86
  > 
  > # 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)