Calculate or extract the soil/atmosphere efflux
from cfp_pfres
or cfp_fgres
model results.
Usage
efflux(x, ...)
# S3 method for class 'cfp_pfres'
efflux(x, ...)
# S3 method for class 'cfp_fgres'
efflux(x, ..., method = "lm", layers = NULL)
# S3 method for class 'cfp_altres'
efflux(x, ...)
Arguments
- x
A cfp_pfres or cfp_fgres model result, or a cfp_altres.
- ...
Arguments passed to methods.
- method
Method(s) used to interpolate the efflux at the top of the soil from partial fluxes within the soil. One of
- top
Use the flux in the topmost model layer.
- lm
A linear model where each partial flux is centered in the respective layer and the model is evaluated at the top of the soil.
- lex
Linearly extrapolate using fluxes of two layers in the soil.
- layers
Vector of two integers selecting the layers for the
lex
method. Layers are indexed from 1 (topmost) to the number of layers used in the flux calculation.
Value
A data.frame
with one row for each
combination of id_cols
and the column efflux
in \(µmol m^{-2}s^{-1}\).
Examples
my_dat <- ConFluxPro::base_dat |>
filter(Date < "2021-03-01") #subset to speed up example
PROFLUX <- pro_flux(my_dat)
FLUX <- fg_flux(my_dat)
#>
#> validating datasets
#> id_cols: site, Date, gas
#> 4 unique profiles
efflux(PROFLUX)
#>
#> A cfp_profile object
#> id_cols: site Date gas
#> 4 unique profiles
#>
#> site Date gas efflux prof_id
#> 1 site_a 2021-01-01 CO2 0.8347288 1
#> 2 site_b 2021-01-01 CO2 0.6741332 2
#> 3 site_a 2021-02-01 CO2 1.3672901 3
#> 4 site_b 2021-02-01 CO2 1.0613224 4
efflux(FLUX)
#>
#> A cfp_profile object
#> id_cols: site Date gas
#> 4 unique profiles
#>
#> mode prof_id efflux site Date gas
#> 1 LL 1 0.3531993 site_a 2021-01-01 CO2
#> 2 LL 2 0.2884947 site_b 2021-01-01 CO2
#> 3 LL 3 0.5675383 site_a 2021-02-01 CO2
#> 4 LL 4 0.4411681 site_b 2021-02-01 CO2