R Under development (unstable) (2024-02-19 r85946 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 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. > > library('geostatsp') Loading required package: Matrix Loading required package: terra terra 1.7.71 > > grd <- rast(extent = c(0,10,0,10), res = c(1,1)) > polys <- as.polygons(grd) > centroids <- crds(as.points(polys))[seq(from=1, by=4, len=ncell(grd)),] > x <- centroids[,1] > y <- centroids[,2] > z <- 1.4 + 0.1*x + 0.2*y + 0.002*x*x > xpoly <- polys > values(xpoly) =data.frame(x=x, y=y, z=z, row.names=row.names(polys)) > > names(xpoly)=paste("stuff", + 1:length(names(xpoly)), sep="") > > > template = squareRaster(xpoly, 100) > > thebrick = spdfToBrick( + x=xpoly, + template=template, + pattern='^stuff[[:digit:]]$' + ) > > plot(thebrick[[1]]) > > > proc.time() user system elapsed 3.64 0.17 3.81