cfp_layers_map {ConFluxPro} | R Documentation |
Model layers
Description
A function to create a cfp_layers_map object that defines the
layers of both fg_flux()
and pro_flux()
models.
Usage
cfp_layers_map(x, ...)
## S3 method for class 'cfp_dat'
cfp_layers_map(x, ...)
## S3 method for class 'data.frame'
cfp_layers_map(
x,
id_cols,
gas = NULL,
lowlim = NULL,
highlim = NULL,
layer_couple = 0,
...
)
Arguments
x |
(data.frame) That defines the layers for which the production or flux is modeled. Note that some parameters can also be provided directly to the function call instead (see Details).
|
... |
not used |
id_cols |
Column names in data.frame that uniquely identify each profile. |
gas |
(character vector) of gas names to be added to x which is then repeated for each gas. |
lowlim |
(numeric vector) the same length as |
highlim |
(numeric vector) the same length as gas with the
upper limit of possible production allowed in |
layer_couple |
|
Value
A cfp_layered_profile()
data.frame
with the columns
described above as well as layer
and pmap
columns that identify
each layer with an integer (ascending from bottom to top).
Add lowlim and highlim for multiple gases
Sometimes it is practical to model different gases with different limits. For example, it is a reasonable assumption that CO2 is not consumed in relevant amounts in most soils, whereas CH4 may be both produced or consumed. Therefore we may want to limit production rates of CO2 to only positive values, whereas allowing for negative CH4 production rates (i.e. consumption) as well.
To make this setup easy, you can provide a gas
vector to the function
together with highlim
and lowlim
vectors of the same length.
The provided layers_map
data.frame
will then be replicated for
each gas with the respective values of the production limits provided.
See Also
Other data formats:
cfp_dat()
,
cfp_gasdata()
,
cfp_layered_profile()
,
cfp_profile()
,
cfp_soilphys()
Examples
cfp_layers_map(
ConFluxPro::layers_map,
gas = "CO2",
lowlim = 0,
highlim = 1000,
id_cols = "site")
### add multiple gases at once
cfp_layers_map(
ConFluxPro::layers_map,
id_cols = "site",
gas = c("CO2", "CH4"),
lowlim = c(0, -1000),
highlim = c(1000, 1000))
### Extract from an existing cfp_dat
cfp_layers_map(ConFluxPro::base_dat)