[R-sig-Geo] st_sample with raster

Edzer Pebesma edzer@pebe@m@ @end|ng |rom un|-muen@ter@de
Sat Aug 10 10:38:24 CEST 2019


sf::st_sample has a size argument, which can be specified as a vector to
operate per feature. If you give that a value equal to

st_area(obj) * obj$required_density

and maybe set exact = FALSE, you should get the densities you want.

On 7/30/19 12:25 AM, Tyler Frazier via R-sig-Geo wrote:
> Hi All,
> 
> Spatstat::rpoint has an argument f that accepts a pixel image object (class .im) to generate points based on the proportionate probability density of that raster.  Just wondering, does sf::st_sample or perhaps another function have a similar available method?
> 
> Thanks so much!
> Ty
> 
> Tyler Frazier, Ph.D.
> Lecturer of Interdisciplinary Studies
> Data Science Program
> College of William and Mary
> Webpage: http://tjfrazier.people.wm.edu
> Phone: +01 (757) 386-1269
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> 

-- 
Edzer Pebesma
Institute for Geoinformatics
Heisenbergstrasse 2, 48151 Muenster, Germany
Phone: +49 251 8333081

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pEpkey.asc
Type: application/pgp-keys
Size: 2472 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20190810/bbbfb641/attachment.bin>


More information about the R-sig-Geo mailing list