Learn R Programming

spatialEco (version 0.1-5)

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, msamp = 1, sf = 4046.86, stype = "hexagonal", ...)

Arguments

x
sp SpatialPolygonsDataFrame object
pct
Percent of area sampled
join
Join polygon attributed to point sample
msamp
Minimum samples
sf
Scaling factor (default is meters to acres conversion factor)
stype
Sampling type ('random', 'regular', 'nonaligned', 'hexagonal')
...
Additional arguments passed to spsample

Value

A SpatialPointsDataFrame with polygon samples

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