Calculates GEP
flux_gep.Rd
to calculate gross ecosystem production (GEP) from net ecosystem (NEE) exchange and ecosystem respiration (ER) as GEP = NEE - ER. Datetime, PAR and other variables to keep will be taken from the NEE measurement. If it is missing, GEP will be dropped for that pair.
Usage
flux_gep(
fluxes_df,
id_cols,
flux_col,
type_col,
datetime_col,
par_col,
nee_arg = "NEE",
er_arg = "ER",
cols_keep = c()
)
Arguments
- fluxes_df
a dataframe containing NEE and ER
- id_cols
columns used to identify each pair of ER and NEE
- flux_col
column containing flux values
- type_col
column containing type of flux (NEE or ER)
- datetime_col
column containing start of measurement as datetime
- par_col
column containing PAR values for each flux
- nee_arg
argument designating NEE fluxes in type column
- er_arg
argument designating ER fluxes in type column
- cols_keep
columns to keep from fluxes_df. Values from NEE row will be filled in GEP row.
Value
a df with GEP as a flux type, with PAR and datetime from the NEE measurement for each pair of ER and NEE
Examples
data(co2_fluxes)
flux_gep(co2_fluxes, id_cols = "turfID", flux_col = "flux",
type_col = "type", datetime_col = "f_start", par_col = "PAR",
cols_keep = c("temp_soil"))
#> Warning:
#> NEE missing for measurement turfID: 156 AN2C 156
#> # A tibble: 9 × 11
#> datetime turfID PAR type flux f_fluxID f_slope_tz temp_air_ave
#> <dttm> <fct> <dbl> <chr> <dbl> <fct> <dbl> <dbl>
#> 1 2022-07-28 23:47:22 74 WN2… 2.11 GEP 33.8 NA NA NA
#> 2 2022-07-28 23:59:32 109 AN… 1.84 GEP -20.5 NA NA NA
#> 3 2022-07-29 00:06:35 29 WN3… 1.78 GEP NA NA NA NA
#> 4 2022-07-28 23:43:35 156 AN… 1.95 ER 95.6 1 1.56 7.31
#> 5 2022-07-28 23:47:22 74 WN2… 2.11 NEE 52.4 2 0.853 7.38
#> 6 2022-07-28 23:52:10 74 WN2… 2.04 ER 18.6 3 0.303 7.46
#> 7 2022-07-28 23:59:32 109 AN… 1.84 NEE 69.4 4 1.13 7.77
#> 8 2022-07-29 00:03:10 109 AN… 1.66 ER 89.9 5 1.46 7.71
#> 9 2022-07-29 00:06:35 29 WN3… 1.78 NEE 26.2 6 0.426 7.75
#> # ℹ 3 more variables: temp_soil <dbl>, temp_fahr <dbl>, temp_kelvin <dbl>