Skip to contents

Computes summary statistics for cells in a WhiteboxRaster object.

Usage

# S3 method for class '`wbw::WhiteboxRaster`'
summary(object, ...)

# S3 method for class '`wbw::WhiteboxRaster`'
max(object, ...)

# S3 method for class '`wbw::WhiteboxRaster`'
mean(x, ...)

# S3 method for class '`wbw::WhiteboxRaster`'
median(x, na.rm = FALSE, ...)

# S3 method for class '`wbw::WhiteboxRaster`'
min(object, ...)

stdev(x)

variance(x)

Arguments

object

WhiteboxRaster object

...

additional arguments (not used)

x

WhiteboxRaster object

na.rm

logical indicating whether NA values should be stripped (not used)

Value

numeric value

Examples

f <- system.file("extdata/dem.tif", package = "wbw")
wbw_read_raster(f) |>
  summary()
#> Number of non-nodata grid cells: 580800
#> Number of nodata grid cells: 0
#> Image minimum: 63.69819259643555
#> Image maximum: 361.0207214355469
#> Image range: 297.3225288391113
#> Image total: 96935805.29621124
#> Image average: 166.90049121248492
#> Image variance: 2370.364458272903
#> Image standard deviation: 48.68638883993044
f <- system.file("extdata/dem.tif", package = "wbw")
wbw_read_raster(f) |>
  max()
#> [1] 361.0207
f <- system.file("extdata/dem.tif", package = "wbw")
wbw_read_raster(f) |>
  mean()
#> [1] 166.9005
f <- system.file("extdata/dem.tif", package = "wbw")
wbw_read_raster(f) |>
  median()
#> [1] 162.3418
f <- system.file("extdata/dem.tif", package = "wbw")
wbw_read_raster(f) |>
  min()
#> [1] 63.69819
f <- system.file("extdata/dem.tif", package = "wbw")
wbw_read_raster(f) |>
  stdev()
#> [1] 48.68639
f <- system.file("extdata/dem.tif", package = "wbw")
wbw_read_raster(f) |>
  variance()
#> [1] 2370.364