R Under development (unstable) (2025-06-23 r88347 ucrt) -- "Unsuffered Consequences" Copyright (C) 2025 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > rm(list = ls(all.names = TRUE)) > > options(warn = -1) # Temporarily suppress warnings > old_omp_thread_limit <- Sys.getenv("OMP_THREAD_LIMIT") > Sys.setenv(OMP_THREAD_LIMIT = "2") > > library(psgp) Loading required package: intamap Loading required package: sp > set.seed(100) > # set up data: > data(meuse) > coordinates(meuse) <- ~x+y > meuse$value <- log(meuse$zinc) > data(meuse.grid) > gridded(meuse.grid) <- ~x+y > proj4string(meuse) <- CRS("EPSG:28992") > proj4string(meuse.grid) <- CRS("EPSG:28992") > > # set up intamap object: > psgpObject <- createIntamapObject( + observations = meuse, + formulaString = as.formula(value~1), + predictionLocations = meuse.grid, + class = "psgp" + ) [1] "rgdal has been retired. \n As a result of this, some of the checks on projections in the \n intamap package have disappeared" > > # run test: > checkSetup(psgpObject) Checking object ... OK > > # do interpolation steps: > psgpObject <- estimateParameters(psgpObject) Range: 716.69 Sill: 0.77 Nugget: 0.01 Bias: 0.17 Covariance function : Isotropic Exponential Range (P0) :716.690 Variance (P1) :0.766 Covariance function : Matern 5/2 covariance function Length scale (P0) :716.690 Variance (P1) :0.766 Covariance function : Constant Amplitude (P0) :0.170 Covariance function : White noise Variance (P0) :0.007 > > # make prediction > psgpObject <- spatialPredict(psgpObject) Covariance function : Isotropic Exponential Range (P0) :853.589 Variance (P1) :1.070 Covariance function : Matern 5/2 covariance function Length scale (P0) :1307.069 Variance (P1) :0.881 Covariance function : Constant Amplitude (P0) :0.024 > > # Plot prediction > # plotIntamap(psgpObject) > # plotIntamap(meuse, pch=1, cex=sqrt(meuse$value)/20, add=TRUE) > > # Restore original settings at the end > Sys.setenv(OMP_THREAD_LIMIT = old_omp_thread_limit) > options(warn = 0) # Restore warning level > > proc.time() user system elapsed 2.31 0.34 2.64