Learn R Programming

spatialEco (version 1.3-7)

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,
  min.samp = 1,
  max.samp = NULL,
  sf = 4046.86,
  stype = "hexagonal",
  ...
)

Value

A SpatialPointsDataFrame with polygon samples

Arguments

x

sp SpatialPolygonsDataFrame object

pct

Percent of area sampled

join

Join polygon attributed to point sample

min.samp

Minimum number of samples

max.samp

Maximum number of samples

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>

Examples

Run this code
require(sp)
sr1=Polygons(list(Polygon(cbind(c(180114, 180553, 181127, 181477, 181294, 
  181007, 180409, 180162, 180114), c(332349, 332057, 332342, 333250, 333558, 
  333676, 332618, 332413, 332349)))),'1')
sr2=Polygons(list(Polygon(cbind(c(180042, 180545, 180553, 180314, 179955, 
  179142, 179437, 179524, 179979, 180042), c(332373, 332026, 331426, 330889, 
  330683, 331133, 331623, 332152, 332357, 332373)))),'2')
sr=SpatialPolygons(list(sr1,sr2))
srdf=SpatialPolygonsDataFrame(sr, data.frame(row.names=c('1','2'), PIDS=1:2))

ars <- parea.sample(srdf, pct=0.20, stype='random') 
  plot(srdf)
    plot(ars, pch=20, add=TRUE)

Run the code above in your browser using DataLab