local_group {ursa} | R Documentation |
Create single-band raster using statistics of multi-bands raster.
Description
Local operations (mean value, sum of values, median, minimum, maximum) of map algebra for multi-bands ursaRaster
object.
Usage
local_mean(x, cover = 0.5 - 1e-3, weight = NULL, verbose = FALSE, bandname = "mean")
local_sum(x, cover = 0.5 - 1e-3, weight = NULL, verbose = FALSE, bandname = "sum")
local_median(x, cover = 0.5 - 1e-3, verbose = FALSE)
local_min(x, cover = 0.5 - 1e-3, verbose = FALSE)
local_max(x, cover = 0.5 - 1e-3, verbose = FALSE)
local_sd(x, cover = 0.5 - 1e-3, verbose = FALSE)
local_var(x, cover = 0.5 - 1e-3, verbose = FALSE)
local_quantile(x, probs = seq(0, 1, 0.25), type = 7, cover = 0.5 - 1e-3, verbose = FALSE)
## S3 method for class 'ursaRaster'
mean(x, ...)
## S3 method for class 'ursaRaster'
median(x, ...)
## S3 method for class 'ursaRaster'
quantile(x, ...)
# non public
.average(x, cover = 0.5 - 1e-3, weight = NULL, sum = FALSE, verbose = FALSE)
Arguments
x |
|
cover |
Numeric. |
weight |
Positive numeric of length equal to number of bands. For |
sum |
Logical. For |
probs |
Numeric. For |
type |
Numeric. For |
verbose |
Logical. If |
bandname |
Character. Band name for created single-band image. |
... |
Function |
Details
If for valid output cell value it is required to have at least m
values not marked as NA
, specify quota as cover=m/nband(x)
.
local_mean
and local_sum
are wrapper to non-public function .average
.
Generic functions mean
, median
, sd
for ursaRaster
class are implemented via local_mean
, local_median
, local_sd
, respectively.
Value
Double-band ursaRaster
object for local_range()
.
Multi-band ursaRaster
object for local_quantile()
.
Otherwise, single-band ursaRaster
object.
Author(s)
Nikita Platonov platonov@sevin.ru
See Also
If bands are interpreted as time series, apply local_stat
Mean value for image brick global_mean
Mean value for each band band_mean
Examples
session_grid(NULL)
b <- ursa_dummy(nband=7,min=0,max=100,mul=1/16)
b[b<40] <- NA
print(b)
res <- c('mean'=mean(b),'local_mean'=local_mean(b)
,'sum0'=local_sum(b,cover=0),'sum1'=local_sum(b,cover=1))
print(res)
display(b)
display(res)