Rainer M Krug
2008-Feb-14 13:52 UTC
[R] Analysis with spatstat and Kcross() requires to much memory
Hi I am running analysis with Kcross from the package spatstat and I am getting a message that R can not allocate enough memory for a vector of 900MB. R seems to be running towards the 2GB limit per process. The dataset is not to big (ca 3000 points) but the mask for the points is extremely irregular (a buffer around roads which have been sampled) and I can do trhe analysis if I use a rectangular mask covering the whole area (which is obviously not correct). My question is: is there a way of splitting the dataset or changing the mask son that I can do the analysis, as I don't want to move to a 64bit computer (if not necessary). Thanks, Rainer My computrer: SuSE 10, 32 bit, 1GB ram, 1GB swap. R:> version_ platform i686-pc-linux-gnu arch i686 os linux-gnu system i686, linux-gnu status major 2 minor 6.2 year 2008 month 02 day 08 svn rev 44383 language R version.string R version 2.6.2 (2008-02-08) -- Rainer M. Krug, Dipl. Phys. (Germany), MSc Conservation Biology (UCT) Plant Conservation Unit Department of Botany University of Cape Town Rondebosch 7701 South Africa [[alternative HTML version deleted]]
Roger Bivand
2008-Feb-15 13:41 UTC
[R] Analysis with spatstat and Kcross() requires to much memory
Rainer M Krug <r.m.krug <at> gmail.com> writes:> > Hi > > I am running analysis with Kcross from the package spatstat and I am getting > a message that R can not allocate enough memory for a vector of 900MB. > R seems to be running towards the 2GB limit per process. > > The dataset is not to big (ca 3000 points) but the mask for the points is > extremely irregular (a buffer around roads which have been sampled) and I > can do trhe analysis if I use a rectangular mask covering the whole area > (which is obviously not correct).Rainer, Would it be possible for you to rasterise the road buffer (I'm assuming that it is a vector buffer), so that the window is an image mask rather than a polygon window? My assumption would be that as.im() would get you there, but you'd need to watch the dimyx= argument. It is also usually helpful to look at traceback() after such a failure, so that you can see at which point in Kcross things fell apart - that is, which internal function was being used. Then you can concentrate on finding a way of solving that specific problem. Roger> > My question is: is there a way of splitting the dataset or changing the mask > son that I can do the analysis, as I don't want to move to a 64bit computer > (if not necessary). > > Thanks, > > Rainer >