percCover: Calculate the percentage cover of raster classes in a...

Description Usage Arguments Value See Also Examples

Description

Given discrete high resolution raster (raster) and a lower resolution template raster (template) and set of evaluation points, calculate the percentage cover of each class of raster in the cells of template identified by points.

Usage

1

Arguments

raster

A high-resolution discrete raster layer.

template

A lower resolution raster for which percentage cover of raster is to be calculated.

points

A set of points determining the pixels in template for which percentage cover is to be calculated. These are passed to the x argument of rasterize, so anything that function will accept should work here.

codes

A numeric vector giving the class labels for raster.

Value

A dataframe giving the percentage cover in the required pixels.

See Also

rasterize

Examples

1
2
3
4
5
6
7
8
# create a raster
r <- raster(nrows = 100, ncols = 100,
              xmn = 0, xmx = 10,
              ymn = 0, ymx = 10)
r <- setValues(r, round(runif(ncell(r)) * 10))
tmp <- aggregate(r, 10)
pts <- xyFromCell(tmp, sample(1:ncell(tmp), 3))
percCover(r, tmp, pts, 1:10)

SEEG-Oxford/seegSDM documentation built on May 9, 2019, 11:08 a.m.