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!
> 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
> [hidden email] > https://stat.ethz.ch/mailman/listinfo/r-sig-geo >
Institute for Geoinformatics
Heisenbergstrasse 2, 48151 Muenster, Germany
Phone: +49 251 8333081