Learn R Programming

ursa (version 3.10.4)

band_group: Extract certain statistics of each band.

Description

Function from this band.* list returns required statistics for each band.

Usage

band_mean(obj)
band_sd(obj)
band_sum(obj)
band_min(obj)
band_max(obj)
band_n(obj)
band_nNA(obj)
band_quantile(obj, ...)

Value

Named vector of numerical or integer values. Band names are used for naming.

Arguments

obj

Object of class ursaRaster.

...

Arguments, which are passed to generic quantile function, e.g. probs, type.

Author

Nikita Platonov platonov@sevin.ru

Details

  • band_mean returns mean value.

  • band_sd returns value of standard deviation with n-1 denominator.

  • band_sum returns sum of values.

  • band_min returns minimal value.

  • band_max returns maximal value.

  • band_n returns number of non-NA pixels.

  • band_nNA returns number of NA pixels.

  • band_quantile returns matrix of quantiles.

See Also

band_stat

Examples

Run this code
session_grid(NULL)
a <- ursa_dummy()
print(a)
print(a<80)
print(class(a))
a[a<80]
a[a<80] <- NA
b1 <- band_stat(a)
print(b1)
b2.n <- band_n(a)
str(b2.n)
b2.mean <- band_mean(a)
print(b1$mean)
print(b2.mean)
print(b1$mean-b2.mean)
print(band_quantile(a))

Run the code above in your browser using DataLab