Skip to content
Prev 17964 / 29559 Next

Memory problems with dnearneigh in spdep

Thanks so much, Roger, for your suggestions.
I should have realized it was taking kilometers rather than meters!

My summary(r) is:
Object of class SpatialPointsDataFrame
Coordinates:
??????????????? min????? max
coords.x1 -17.52090 51.40407
coords.x2 -34.82918 37.53746
Is projected: TRUE 
proj4string :
[+proj=aea +lat_1=20 +lat_2=-23 +lat_0=0 +lon_0=25 +x_0=0 +y_0=0 +ellps=WGS84
+datum=WGS84 +units=m +no_defs +towgs84=0,0,0]
Number of points: 36820887
Data attributes:
??? POINTID?????????? GRID_CODE??????? 
?Min.?? :????? 1??? Min.?? :???? 0.00? 
?1st Qu.: 250000??? 1st Qu.:???? 0.28? 
?Median : 500000??? Median :???? 2.57? 
?Mean?? : 500000??? Mean?? :??? 26.43? 
?3rd Qu.: 750000??? 3rd Qu.:??? 10.51? 
?Max.?? : 999999??? Max.?? :103104.70? 
?NA's?? :35820888? 


It seems that there are a lot of NA's. (Everything in the square outside the continent's borders should be an NA, so maybe that's a reasonable number). It seemed right when I plotted it earlier.

I ran it with 9.333 as the distance band (then I was going to try 1.5 next).
nb<- dnearneigh(r, 0, 9.333)

It used a constant amount of memory for the first ~90 minutes and then it increased at a constant rate for the next 20 hours
until it was using virtually all the memory on the server and was stopped.
Because the administrator had to kill my job, I wasn't able to get session info while the session was open. I'm not sure this is at all helpful, but when I re-started R this is the sessionInfo() :
R version 2.15.3 (2013-03-01)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
?[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C???????? LC_TIME=C??????????? LC_COLLATE=C?????? ?
?[5] LC_MONETARY=C??????? LC_MESSAGES=C??????? LC_PAPER=C?????????? LC_NAME=C????????? ?
?[9] LC_ADDRESS=C???????? LC_TELEPHONE=C?????? LC_MEASUREMENT=C???? LC_IDENTIFICATION=C 

attached base packages:
[1] stats???? graphics? grDevices utils???? datasets? methods?? base??? ?

loaded via a namespace (and not attached):
[1] tools_2.15.3

Thanks,
Juliann