1

I am a beginner in R and geostatistics. I have a large SpatialPointsDataframe (307,907 elements, 27.2MB). When I want to use this data to build a variogram, it needs a lot of time (R runs for a day without any results). I think this is probably because R normally does single-core processing. Thus, is there a way for R to work with multiple cores in building a variogram? Is the function foreach can do this?

library(reader)
library(gstat)
library(sp)
coordinates(data_del) <- ~X1+X2
variogram <- variogram(X3~1, data_del, cutoff = 100, width =10)
Hongyi Lyu
  • 11
  • 1
  • R seems to be picky about what it can parallelize at times. Have you read any resources on the topic? For example, I know some raster processes don't parallelize easily. Obviously, this isn't a raster. https://nceas.github.io/oss-lessons/parallel-computing-in-r/parallel-computing-in-r.html https://cran.r-project.org/web/packages/doParallel/vignettes/gettingstartedParallel.pdf – John Polo Aug 07 '22 at 00:21

0 Answers0