parea.sample | R Documentation |
Creates a point sample of polygons where n is based on percent area
parea.sample(x, pct = 0.1, join = FALSE, sf = 4046.86, stype = "random", ...)
x |
An sf POLYGON object |
pct |
Percent of area sampled |
join |
FALSE/TRUE Join polygon attributed to point sample |
sf |
Scaling factor (default is meters to acres conversion factor) |
stype |
Sampling type ('random', 'regular', 'nonaligned', 'hexagonal') |
... |
Additional arguments passed to spsample |
This function results in an adaptive sample based on the area of each polygon. The default scaling factor (sf) converts meters to acres. You can set sf=1 to stay in the native projection units
An sf POINT object
Jeffrey S. Evans <jeffrey_evans@tnc.org>
library(sf)
nc <- st_read(system.file("shape/nc.shp", package="sf"))
nc <- suppressWarnings(st_cast(nc[c(10,100),], "POLYGON"))
( ars <- parea.sample(nc, pct=0.001, join = TRUE, stype='random') )
plot(st_geometry(nc))
plot(st_geometry(ars), pch=19, add=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.