Last chance! 50% off unlimited learning
Sale ends in
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.
band_stat(x, grid = FALSE, raw = FALSE)
Object of class ursaRaster
.
Logical. If TRUE
then metadata are returned instead of statistics. Default is FALSE
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 transformed to numerical values, then function returns statistics for decategorized values. Default is FALSE
.
data.frame
. Row names are indices of bands. Column names are:
Band name.
Mean value.
Value of standard deviation with n-1
denomination.
Sum of values.
Minimal value.
Maximal value.
Number of non-NA
pixels.
Number of NA
pixels.
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.
Columns extraction from returned data frame is in the group of band.*
functions.
# NOT RUN {
session_grid(NULL)
s <- substr(as.character(sessionInfo()),1,48)
a <- reclass(ursa_dummy(mul=1/2,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)
# }
Run the code above in your browser using DataLab