1

Using the spgwr package I followed this tutorial and found a way to interpolate the result to a raster layer (gwr on pixel/raster data using the meuse data set, further down the script). But the second step is taking hour by hour and I am not sure if R is hanging or if the code is wrong.

Here is what I did until now:

# calculating the bandwidth     
bw<- gwr.sel(pb_train ~ gesteine + schnee_tag_1 + rs_hospso, data=env.spdf, adapt=FALSE)

# running first gwr model
fGo<- gwr(pb_train ~ gesteine + schnee_tag_1 + rs_hospso, env.spdf, bandwidth=bw, hatmatrix=TRUE)

spplot(fGo$SDF, "pred")

enter image description here

This is where R keeps hanging...

gwr.priclus<- gwr(pb_train ~ gesteine + schnee_tag_1 + rs_hospso, env.spdf, bandwidth=bw, fit.points=env.grid, predict=TRUE, se.fit=TRUE, fittedGWRobject = fGo)

env.spdf is a SpatialPointsDataFrame with my predictors at each location. env.grid is a SpatialPixelsDataFrame that contains the coordinates and the predictor values for the entire study area.

What am I doing wrong here? I would also like to know what exactly happens within the scond step.

  • I ran it over night and get the following warning message: Warning messages: 1: In anyDuplicated.default(new) : Reached total allocation of 8110Mb: see help(memory.size) 2: In anyDuplicated.default(new) : Reached total allocation of 8110Mb: see help(memory.size) So maybe it is a problem of memory size? – parallax Apr 19 '17 at 6:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.