Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

vertical.aggregate.brick.within.depth

Aggregates with a mean or an addition on the vertical profile the values of a 'brick' within a certain depth and returns the vertical aggregated map


Description

Aggregates with a mean or an addition on the vertical profile the values of a 'brick' within a certain depth and returns the vertical aggregated map

Usage

vertical.aggregate.brick.within.depth(x, depth = NULL, layers = NULL,
  i0 = NULL, verify = FALSE, FUN = identity,
  divide.by.depth = FALSE, ...)

Arguments

x

a 'RasterBrick' or a three-dimensional array

depth

depth map, generally a 'RasterLayer' object

layers

vector of layer thickness

i0

a 'Raster' containing the number of soil laver just over the bedrock. Default is NULL and is then calculated.

verify

logical. Default is FALSE. If it is TRUE, it verifies that function is working correctly.

FUN

function used for aggregation. If missing, identity is the default value.

divide.by.depth

logical. If TRUE the function returns the 'mean' value, otherwise a a cumulate value. Default is FALSE.

...

further argument for FUN

Value

a list of 'Raster' maps:

i0 a 'Raster' containing the number of soil laver just over the bedrock

z0 a 'Raster' containing the depth of the center of the i0-th layer

result a 'Raster' containing the aggregated map

Note

x and depth or i0 must cover the same spatial region.

See Also

Examples

library(geotopbricks)
# The examples is the following R script conteined 
# in a 'inst' directory of the package source
f <- system.file("doc/examples/example.vertical.aggregate.brick.within.depth.R",
package="geotopbricks")
#  source(f) # Uncomment this line to run the example. 
# You can copy the example file using file.copy(from=f,to=....,...) See file.copy documentation

geotopbricks

An R Plug-in for the Distributed Hydrological Model GEOtop

v1.5.4
GPL (>= 2)
Authors
Emanuele Cordano, Daniele Andreis, Fabio Zottele
Initial release
2020-02-10

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.