Dear list,
I have a set of relocation data (call it pnts).
What I want to do is to create, for each relocation of pnts, n alternative
relocations within a radius r.
My intuitive approach was to use of the spsample function in the sp
package.
buffer <- gBuffer(spgeom = pnts, width=r, byid=T)
randompoints <- spsample(x=buffer, n=10, type="random", iter=10)
The problem here is that spsample creates 10 random points over all
Polygons in the buffer object and not for each Polygon within buffer.
Is there a function that returns random locations by passing a
SpatialPoints-class object to it and a radius r?
Any help is appreciated.