- dat
a data frame with bottle identification code; time of measurement (as numeric
, or POSIX
); and measured biogas volume.
See Details section for details on units.
Additional columns can be present--these will be returned in the output data frame.
See data.struct
argument for details on how data frames are structured.
- comp
(optional) a data frame with the columns bottle identification code; time of measurement, (as numeric
, or POSIX
); and methane concentration within dry biogas as a mole fraction, considering only methane and carbon dioxide (unless cmethod = "total"
) or a single numeric value.
If omitted, cumulative biogas volume will still be calculated and returned (but no methane data will be returned).
The names of these columns are specified with id.name
, time.name
, and comp.name
.
Default is NULL
.
- temp
the temperature at which biogas volume was measured.
A length-one numeric vector.
Degrees Celcius by default (see unit.temp
argument).
Default is NULL
, which suppresses correction for temperature and pressure.
- pres
the absolute pressure at which biogas volume was measured.
A length-one numeric vector or a character vector giving the name of the column in dat
with the pressure measurements.
Atmospheres by default (see unit.pres
argument).
Default is NULL
, which suppresses correction for temperature and pressure.
- interval
do biogas volume measurements represent production only from the time interval between observations (default)?
interval = FALSE
means measured gas volume is cumulative.
Default is TRUE
.
- data.struct
the structure of input data. The default of 'longcombo' means volume and composition (if available) are both in dat
.
The dat
data frame must have bottle identification code and time columns with names specified with id.name
and time.name
, volume data in a single column with the name specified by vol.name
, and biogas composition in a single column with the name specified by comp.name
For the data.struct = 'long'
option, two separate data frames are needed, one for volume and one for composition (if available).
Each data frame must have bottle identification code and time columns with names specified with id.name
and time.name
.
The dat
data frame must have volume data in a single column with the name specified by vol.name
.
The comp
data frame must have biogas composition in a single column with the name specified by comp.name
.
For the data.struct = 'wide'
option, two separate data frames are needed as in 'long'
, but there are no bottle identification code columns.
Instead, in dat
, volume data are in a separate column for each bottle, and column names are bottle identification codes.
Here, vol.name
should be the name of the first column with volume data.
All following columns are assumed to also have volume data.
And in comp
, biogas composition data are also in a separate column for each bottle, also with bottle identification codes for column names.
Here, comp.name
should be the name of the first column with biogas composition data, as for dat
.
- id.name
name of the bottle identification code column in dat
. Must be the same in all data frames used in the function. Default is "id"
.
- time.name
name of column containing time data in dat
and comp
data frames. Default is "time"
.
- vol.name
name of column containing the primary response variable (as-measured volume) in dat
data frame. Default is vol
.
- comp.name
name of column containing biogas mole fraction of methane in comp
data frame. Default is "xCH4"
. Must be normalised so xCH4 + xCO2 = 1.0 unless cmethod = "total"
.
- headspace
(optional) a data frame or length-one numeric vector with bottle headspace volume(s).
If a data frame is used, it should at least contain a "id"
(bottle identification code) column (see "id.name"
) and headspace volume column (see vol.hs.name
argument).
Required if cmethod = "total"
.
Default is NULL
.
- vol.hs.name
name of column containing headspace volume data in optional headspace
data frame.
Default is "vol.hs"
.
- cmethod
method for calculating cumulative methane production.
Use "removed"
to base production on xCH4
and gas volumes removed (default).
Use "total"
to base it on the sum of methane removed and methane remaining in the bottle headspace.
For "removed"
, xCH4
should be calculated based on methane and CO2 only (xCH4 + xCO2 = 1.0).
For "total"
, xCH4
should be calculated including all biogas components (CH4, CO2, N2, H2S, etc.) except water.
Length one character vector.
- imethod
method used for interpolation of xCH4
.
This is passed as the method
argument to interp
.
Length one character vector.
Default is "linear"
for linear interpolation.
- extrap
should comp.name
be extrapolated?
Length one logical vector.
This is passed as the extrap
argument to interp
.
Default is FALSE
.
- addt0
is the earliest time in dat
data frame “time zero” (start time)?
If not, this argument adds a row with time.name = 0
for each bottle in order to calculate production rates for the first observation.
This addition is only made when time.name
is numeric
(or integer
).
Length-one logical vector.
Default is TRUE
.
To return these additional rows in the output, see showt0
.
- showt0
should “time zero” rows be returned in the output?
Can be convenient for plotting cumulative volumes.
Only applies if time.name
is numeric
(or integer
).
These rows may have been present in the original data (dat
) or added by the function (see addt0
).
Default value depends on dat
time.name
column content.
If time.name
column is numeric and contains 0 then the default value is TRUE
and otherwise FALSE
.
- dry
set to TRUE
if volume data are standardised to dry conditions (e.g., AMPTS II data).
The default (FALSE
) means biogas is assumed to be saturated with water vapor.
- empty.name
column containing a binary (logical, or integer or numeric (1 or 0)) variable indicating when accumulated biogas was emptied.
Use for mix of cumulative/interval data.
If used, interval
is ignored.
- std.message
should a message with the standard conditions be displayed?
Default is TRUE
.
- check
should input data be checked for unreasonable values (with warnings)?
Currently only composition values are checked.
Default is TRUE
.
Values are changed if outside 0, 1 (divided by 100).
- temp.std
standard temperature for presentation of biogas and methane results.
Length one numeric vector.
Default value is 0 degrees C (set in stdVol
).
Argument is passed to stdVol
.
- pres.std
standard pressure for presentation of biogas and methane results.
Length one numeric vector.
Default value is 1.0 atm (101325 Pa) (set in stdVol
).
Argument is passed to stdVol
.
- unit.temp
temperature units for temp
and temp.std
arguments.
Default is "C"
.
Argument is passed to stdVol
.
- unit.pres
pressure units for pres
and pres.std
arguments.
Default is "atm"
.
Argument is passed to stdVol
.
- quiet
use to suppress messages. Default is FALSE
.