Ops.band_stat: Computes statistics for each band of raster.

Description Usage Arguments Details Value Author(s) See Also Examples

Description

For each band of ursaRaster object, band_stat returns certain statistics (mean, sd, sum, min, max, number of non-NA pixels, number of NA pixels). Regarding to each band, it is global operations of map algebra.

Usage

1

Arguments

x

Object of class ursaRaster.

grid

Logical. If TRUE then metadata are returned instead of statistics. Default is FALSE

raw

Logical. For the case of raster values are categories, if raw=TRUE, then function returns statistics of categories; if raw=FALSE and names of categories can be tranformed to numerical values, then function returns statistics for un-categirized values. Default is FALSE.

Details

If raster values are not in memory or grid=TRUE then ursa_info is returned.

Generic function print for object of class ursaRaster uses returned value of band_stat function with formatted columns.

Statistics is computed for omitted NA values.

Value

data.frame. Row names are indices of bands. Column names are:

name

Band name.

mean

Mean value.

sd

Value of standard deviation with n-1 denomination.

sum

Sum of values.

min

Minimal value.

min

Maximal value.

n

Number of non-NA pixels.

nNA

Number of NA pixels.

Author(s)

Nikita Platonov platonov@sevin.ru

See Also

Columns extraction from returned data frame is in the group of band.* functions.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
session_grid(NULL)
s <- substr(as.character(sessionInfo()),1,48)
a <- reclass(ursa_dummy(bandname=s),ramp=FALSE)
band_stat(a,grid=TRUE)
b2 <- band_stat(a)
b3 <- band_stat(a,raw=TRUE)
str(b2)
str(b3)
print(b2)
print(a) ## 'print.ursaRaster' uses 'band_stat'
print(a,raw=TRUE)

ursa documentation built on Feb. 26, 2020, 3:01 p.m.