Description Usage Arguments Details Value See Also Examples
Compute statistics for the cells of each layer of a Raster* object. In the raster
package, functions such as max, min, and mean, when used with Raster* objects as argument, return a new Raster* object (with a value computed for each cell). In contrast, cellStats returns a single value, computed from the all the values of a layer. Also see layerStats
1 2 3 4 5 |
x |
Raster* object |
stat |
The function to be applied. See Details |
na.rm |
Logical. Should |
asSample |
Logical. Only relevant for |
... |
Additional arguments |
cellStats
will fail (gracefully) for very large Raster* objects except for a number of known functions: sum, mean, min, max, sd, 'skew' and 'rms'. 'skew' (skewness) and 'rms' (Root Mean Square) must be supplied as a character value (with quotes), the other known functions may be supplied with or without quotes. For other functions you could perhaps use a sample of the RasterLayer that can be held in memory (see sampleRegular
)
Numeric
freq
, quantile
, minValue
, maxValue
, setMinMax
1 2 3 4 5 6 7 8 |
Loading required package: sp
[1] 4.807896
[1] 4.807896
layer.1 layer.2
4.807896 4.807896
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.