R/aggregate.brick.at.depth.R
vertical.aggregate.brick.within.depth.RdAggregates 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
vertical.aggregate.brick.within.depth(
x,
depth = NULL,
layers = NULL,
i0 = NULL,
verify = FALSE,
FUN = identity,
divide.by.depth = FALSE,
...
)a 'RasterBrick' or a three-dimensional array
depth map, generally a 'RasterLayer' object
vector of layer thickness
a 'Raster' containing the number of soil laver just over the bedrock. Default is NULL and is then calculated.
logical. Default is FALSE. If it is TRUE, it verifies that function is working correctly.
function used for aggregation. If missing, identity is the default value.
logical. If TRUE the function returns the 'mean' value, otherwise a a cumulate value. Default is FALSE.
further argument for FUN
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
x and depth or i0 must cover the same spatial region.
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