sampleRasterStackByMU {sharpshootR} | R Documentation |
Sample a Raster Stack
Description
Sample a raster stack by map unit polygons, at a constant density.
Usage
sampleRasterStackByMU(
mu,
mu.set,
mu.col,
raster.list,
pts.per.acre,
p = c(0, 0.05, 0.25, 0.5, 0.75, 0.95, 1),
progress = TRUE,
estimateEffectiveSampleSize = TRUE,
polygon.id = "pID"
)
Arguments
mu |
a |
mu.set |
character vector of map unit labels to be sampled |
mu.col |
column name in attribute table containing map unit labels |
raster.list |
a |
pts.per.acre |
target sampling density in |
p |
percentiles for polygon area stats, e.g. |
progress |
logical, print a progress bar while sampling? |
estimateEffectiveSampleSize |
estimate an effective sample size via Moran's I? |
polygon.id |
Column name containing unique polygon IDs; default: |
Details
This function is used by various NRCS reports that summarize or compare concepts defined by collections of polygons using raster data sampled from within each polygon, at a constant sampling density. Even though the function name includes "RasterStack", this function doesn't actually operate on the "stack" object as defined in the raster package. The collection of raster data defined in raster.list
do not have to share a common coordinate reference system, grid spacing, or extent. Point samples generated from mu
are automatically converted to the CRS of each raster before extracting values. The extent of each raster in raster.list
must completely contain the extent of mu
.
Value
A list
containing:
raster.samples
a
data.frame
containing samples from all rasters in the stackarea.stats
a
data.frame
containing area statistics for all map units in the collectionunsampled.ids
an index to rows in the original SPDF associated with polygons not sampled
raster.summary
a
data.frame
containing information on sampled rastersMoran_I
a
data.frame
containing estimates Moran's I (index of spatial autocorrelation)
Author(s)
D.E. Beaudette
See Also
constantDensitySampling
, sample.by.poly