[R] Analysis with spatstat and Kcross() requires to much memory
Roger Bivand
Roger.Bivand at nhh.no
Fri Feb 15 14:41:47 CET 2008
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
>
More information about the R-help
mailing list