[R-sig-Geo] spsample

MacQueen, Don macqueen1 at llnl.gov
Fri Jul 10 17:23:08 CEST 2015

I'm not so deeply familiar with spsample that I know of a way to do this

However, I think it would be pretty easy to use spsample to first obtain
more points than needed, then calculate all the distances from the center,
then use the base::sample function to select a weighted sample, with
weights based on the distance from the center (see the prob argument to


Don MacQueen

Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550

On 7/10/15, 2:59 AM, "R-sig-Geo on behalf of Luca Candeloro"
<r-sig-geo-bounces at r-project.org on behalf of luca.candeloro at gmail.com>

>following the example found in SpeciesDistributionModelling, a given
>of points is drawn randomly within a circle:
>x <- circles(pts, d=50000, lonlat=T, col='light gray')
># sample randomly from all circles
>> samp1 <- spsample(x at polygons, 250, type='random', iter=25)
>Is there a way to specify weigths decreasing from the circle center, so
>that random points are most likely near it?
>thanks ,
>	[[alternative HTML version deleted]]
>R-sig-Geo mailing list
>R-sig-Geo at r-project.org

More information about the R-sig-Geo mailing list