mValues: Cell value distribution

Description Usage Arguments Value See Also Examples

View source: R/measure.operators.R

Description

Calculate distribution parameters of cell values of a raster

Usage

1
mValues(obj, param = NULL, layer = NULL, groupBy = NULL)

Arguments

obj

[Raster*(1)]
The object to measure.

param

[character(.)]
parameter(s) to calculate; possible parameters are "mean", "sum", "number", "sd", "cv", "iqr", "min", "median", "max", "quantile", "weighted.mean" or "all".

layer

[character(1)]
in case obj has several layers, specify here the layer for which the area of objects shall be calculated (by default the first layer).

groupBy

[RasterLayer(1)]
(another) layer based on the unique values of which to calculate distribution parameters (by default the second layer).

Value

A list with elements resulting from the stratification with the value of each specified parameter per object in groupBby.

See Also

Other generic metrics: mAdjacency, mArea, mNumber, mPerimeter

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
con <- rtRasters$continuous
bin <- rBinarise(con, 30)
patches <- rPatches(bin)

# the average and standard deviation of all values
mValues(obj = con, param = c("mean", "sd"))

# destribution parameters per patch ...
mValues(obj = raster::stack(con, patches),
        param = c("weighted.mean", "min", "max"), groupBy = "patches")

# ... or per class
mValues(obj = raster::stack(con, rtRasters$categorical),
        param = c("mean", "sd"), groupBy = "categorical")

EhrmannS/rasterTools documentation built on Sept. 4, 2019, 10:34 a.m.