fluxx | R Documentation |
(Bulk) estimates of (ghg) fluxes from online concentration measurements with non-steady-state closed chambers. The function tries to find stable linear conditions in concentration change by fitting many regressions to the data and automatically detects and excludes rapid concentration fluctations.
fluxx(x, var.par, subset, asterisks = FALSE, loop = "auto", ...) mf.flux(x, var.par, method = "r2", time.unit = "S", all.through = TRUE, iv = 1, wndw = 0.1, pdk = 0.5, min.dp = 20, nrmse.lim = 0.1, r2.qual = 0.9, range.lim = 5, out.unit = "auto", elementar = FALSE, hardflag = list(range = TRUE), consecutive = FALSE)
x |
A list of data tables as returned by |
var.par |
A named list specifying the variables and parameters that are used in the estimation process and variables that should be handed through the function so that they are easily available for further analysis. Some of the names are obligatory (e.g. |
subset |
An optional vector specifying a subset of concentration measurements to be used in the estimation process. |
asterisks |
Logical. If TRUE p-values are given as asterisks and other symbols (p<.001 = "***", .001<p<.01 = "**", .01<p<.05 = "*", .05<p<.1 = ".", p>=.1 == " "). |
loop |
Can be |
... |
Further arguments passed to |
method |
Character string specifying the statistic used for finding the linear part. Partial match to |
time.unit |
Single character giving the appropriate unit of time elapsed between two concentration measurements. Will typically be seconds, thus default is |
all.through |
Logical. When |
iv |
Numeric. Sometimes there is no time information at all but the rows in |
wndw |
Numeric between 0 and 1. Relative width of a moving window in which the standard deviation of the concentrations is calculated to identify high frequency fluctuations. See details and next. |
pdk |
Numeric between 0 and 1. Minimum proportion of data points to be kept. See details. In case one single concentration value occurs more than |
min.dp |
Numeric. The minimum number of data points. Defaults to 20. If there are less rows the estimation is run anyway but a warning is issued and |
nrmse.lim |
The maximum acceptable normalized root mean square error. Numeric value between 0 and 1. Defaults to 0.1. If the final best solution has a higher nrmse it is flagged accordingly. |
r2.qual |
Numeric between 0 and 1. Quality parameter for the model fit. The minimum acceptable R2 of the best fitted model. Defaults to 0.8. When the value is below quality setting a quality flag is reported. |
range.lim |
Numeric. The minimum range of the concentration measurements during one chamber placement. The acceptable range limit depends on the accuracy of the concentration measurements. When the range of the concentration measurements is smaller than the repeatability range of the measurement device one cannot tell real increase in concentration from random fluctuation. Therefore, if the range of the concentration measurements during one chamber placement is < |
out.unit |
Character string determining the output unit of the flux rate mass part. The default "auto" tries to find a unit that ranges the output value between 0.01 and 10. Possible output units are "ng", "mug", "mg", or "g". "mug" stands for "μg" because non-ascii characters are not allowed in functions. Beware of varying mass units in your output when running in auto mode. |
elementar |
When the fluxes are wanted as element values set |
hardflag |
Named list that controls which of the quality flags are to be hard flagged (the value is changed according to the quality flag). Only |
consecutive |
Shall the most linear part be found by a consecutive approach starting at the first concentration reading. As soon as a stable flux is detected, it is stored. Strictly experimental. |
The function is similar to flux
but uses a different algorithm to identify the most linear part of the concentration development. First high frequency fluctations are omitted. Then all possible pdk
* n : n consecutive concentration measurements are regressed against the corresponding times. The model with the highest r2 is chosen.
var.par
specifies the variables within x
and fixed parameters for all chamber placements that are used for the flux estimations. For obligatory var.par
items see flux
and examples. In contrast to flux
there is just one workhorse function doing the actual estimation (mf.flux
) per data table. Especially when there are many data tables in x
and/or many data points per data table it takes some time. Progress is shown in the console. Each dot represents one finalized data table.
fluxx
returns a complex object of class fluxxes
that is a 2 entry list. When the object is printed to the console only the second entry is displayed in a modified form that is meant to maximize information display with small footprint for easy inspection. A table is printed to the console with three columns per gas. The first contains the quality flags (e.g. 111.9). The order is: r2.f
, range.f
,nrmse.f
, nomba.f
. The first three are considered more important, and if they are '1' everything is fine. The last number digit following the full stop gives the number of concentration readings below ambient.
The data.frame
with the estimated flux rates contains all data needed for further analysis. The columns represent the entries in fluss
of the single chamber measurements (including quality flags, see below) plus naming information according to the settings in the nmes
argument of chop
. export
provides a simple way to export the results.
The first entry is itself a list of lists and data tables. It is called flux.res
. The only one first level entry in this list contains the information for one gas which is itself a list. In this list each first level entry contains the information for one chamber measurement. It is named according to the nmes
-setting in chop
and contains the elements fluss
(which is itself a list with the elements given below), mod
, out
(a list with hand through data, list items according to columns in x
that have been handed trough via all.through
or var.par
), and inn
- a data.frame with the input data that were relevant for estimating the flux (the obligatory part of var.par
).
The elements of fluss
:
ghg |
Character. The gas species for which the flux has been estimated. |
flux |
Numeric. Calculated flux rate in mass unit per m2 and hour. |
r2 |
r2 of the best fitted model that has been used for flux caclulation. |
nrmse |
nrmse of the best fitted model that has been used for flux calculation. |
r2.f |
Logical. r2 quality flag telling whether the r2 quality setting given in |
range.f |
Logical. Range quality flag telling whether the range of the concentration measurements exceeded the quality range of the measurement device that has been specified in |
nrmse.f |
Logical. nrmse quality flag telling whether the nrmse quality setting given in |
nomba.f |
Integer. Reports the number of measurements below ambient. When one observes concentrations below ambient that might make the measurements unstable, it is possible to filter the results later and allow only a maximum acceptable number of measurements below ambient. The ambient concentration is build into the function with data from Mace Head Ireland (N2O, CH4) and global average (CO2) obtained from http://cdiac.ornl.gov/pns/current_ghg.html as of August 1st, 2011. |
unit |
The mass unit assigned. |
podpu |
Proportion (expressed as a number between 0 and 1) of data points used for constructing the linear model for estimating the flux rate. The higher the less disturbed the measurements. |
Gerald Jurasinski, gerald.jurasinski@uni-rostock.de
Nakano T (2004) A comparison of regression methods for estimating soil-atmosphere diffusion gas fluxes by a closed-chamber technique. Soil Biology and Biochemistry 36: 107-113.
Forbrich I, Kutzbach L, Hormann A, Wilmking M (2010) A comparison of linear and exponential regression for estimating diffusive CH4 fluxes by closed-chambers in peatlands. Soil Biology and Biochemistry 42: 507-515.
gpp
and reco
for further processing of the results.
## Not run: ## load data data(tt.nee) ## prepare flux estimation # make parts with chop tt.parts <- chop(tt.nee, factors=c("session", "spot"), nmes=c("spot", "date", "session"), min.cm=40) # prepare var.par list (like with flux) vp <- list(CO2 = "NEE", time = "datetime", area = "area", volume = "volume", t.air = "t.cham", p.air = 101325) ## do the flux estimation # run fluxx. with lots of data it may take a while # (approx. 10 sec per chamber) tt.flux <- fluxx(tt.parts, subset=c(1:30), vp, pdk=0.5, range.lim=3, out.unit="mg") # inspect results table tt.flux # plot diagnostic plots plot(tt.flux, dims=c(4,4), subs="spot") # run fluxx with alternative method tt.fluxa <- fluxx(tt.parts, subset=c(1:30), vp, pdk=0.5, range.lim=3, out.unit="mg", method="rmse") # inspect results tt.fluxa ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.