spatialEco (version 2.0-2)

parea.sample: Percent area sample

Description

Creates a point sample of polygons where n is based on percent area

Usage

parea.sample(x, pct = 0.1, join = FALSE, sf = 4046.86, stype = "random", ...)

Value

An sf POINT object

Arguments

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

Author

Jeffrey S. Evans <jeffrey_evans@tnc.org>

Details

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

Examples

Run this code
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)  

Run the code above in your browser using DataLab