- using R version 4.4.3 (2025-02-28 ucrt)
- using platform: x86_64-w64-mingw32
- R was compiled by
gcc.exe (GCC) 13.3.0
GNU Fortran (GCC) 13.3.0
- running under: Windows Server 2022 x64 (build 20348)
- using session charset: UTF-8
- checking for file 'geostatsp/DESCRIPTION' ... OK
- checking extension type ... Package
- this is package 'geostatsp' version '2.0.8'
- checking package namespace information ... OK
- checking package dependencies ... NOTE
Package suggested but not available for checking: 'RandomFields'
- checking if this is a source package ... OK
- checking if there is a namespace ... OK
- checking for hidden files and directories ... OK
- checking for portable file names ... OK
- checking whether package 'geostatsp' can be installed ... OK
See the install log for details.
- used C compiler: 'gcc.exe (GCC) 13.3.0'
- checking installed package size ... OK
- checking package directory ... OK
- checking 'build' directory ... OK
- checking DESCRIPTION meta-information ... OK
- checking top-level files ... OK
- checking for left-over files ... OK
- checking index information ... OK
- checking package subdirectories ... OK
- checking code files for non-ASCII characters ... OK
- checking R files for syntax errors ... OK
- checking whether the package can be loaded ... [9s] OK
- checking whether the package can be loaded with stated dependencies ... [9s] OK
- checking whether the package can be unloaded cleanly ... [9s] OK
- checking whether the namespace can be loaded with stated dependencies ... [10s] OK
- checking whether the namespace can be unloaded cleanly ... [10s] OK
- checking loading without being on the library search path ... [10s] OK
- checking use of S3 registration ... OK
- checking dependencies in R code ... OK
- checking S3 generic/method consistency ... OK
- checking replacement functions ... OK
- checking foreign function calls ... OK
- checking R code for possible problems ... [40s] OK
- checking Rd files ... [1s] OK
- checking Rd metadata ... OK
- checking Rd cross-references ... OK
- checking for missing documentation entries ... OK
- checking for code/documentation mismatches ... OK
- checking Rd \usage sections ... OK
- checking Rd contents ... OK
- checking for unstated dependencies in examples ... OK
- checking contents of 'data' directory ... OK
- checking data for non-ASCII characters ... [10s] OK
- checking data for ASCII and uncompressed saves ... OK
- checking line endings in C/C++/Fortran sources/headers ... OK
- checking line endings in Makefiles ... OK
- checking compilation flags in Makevars ... OK
- checking for GNU extensions in Makefiles ... OK
- checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... OK
- checking use of PKG_*FLAGS in Makefiles ... OK
- checking include directives in Makefiles ... OK
- checking pragmas in C/C++ headers and code ... OK
- checking compiled code ... OK
- checking sizes of PDF files under 'inst/doc' ... OK
- checking installed files from 'inst/doc' ... OK
- checking files in 'vignettes' ... OK
- checking examples ... [31s] ERROR
Running examples in 'geostatsp-Ex.R' failed
The error most likely occurred in:
> ### Name: simLgcp
> ### Title: Simulate a log-Gaussian Cox process
> ### Aliases: simLgcp simPoissonPP
>
> ### ** Examples
>
> mymodel = c(mean=-0.5, variance=1,
+ range=2, shape=2)
>
> myraster = rast(nrows=15,ncols=20,xmin=0,xmax=10,ymin=0,ymax=7.5)
>
> # 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)
>
> myLgcp=simLgcp(param=mymodel,
+ covariates=myCovariate,
+ betas=c(a=-0.1, b=0.25),
+ offset='offsetFooBar',
+ rasterTemplate=myraster)
Warning: PROJ: proj_create: no database context specified (GDAL error 1)
Warning: PROJ: proj_create: no database context specified (GDAL error 1)
Warning: PROJ: proj_create: no database context specified (GDAL error 1)
- checking for unstated dependencies in 'tests' ... OK
- checking tests ... [255s] ERROR
Running 'RFsimulate.R' [18s]
Running 'krige.R' [14s]
Running 'lgcp.R' [14s]
Running 'lgm.R' [41s]
Running 'lgmRaster.R' [101s]
Running 'likfitLgm.R' [11s]
Running 'matern.R' [8s]
Running 'maternGmrfPrec.R' [13s]
Running 'profLlgm.R' [15s]
Running 'simLgcp.R' [9s]
Running 'stackRasterList.R' [10s]
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)
- checking for unstated dependencies in vignettes ... OK
- checking package vignettes ... OK
- checking re-building of vignette outputs ... [56s] OK
- checking PDF version of manual ... [18s] OK
- checking HTML version of manual ... [6s] OK
- DONE
Status: 2 ERRORs, 1 NOTE