| calcBgGrav | R Documentation | 
calcBgGrav calculates cumulative biogas, methane production and production rates from mass loss (gravimetric measurements) and volume measurements for any number of bottles.
calcBgGrav(
  # Main arguments
  dat,
  comp = NULL,              
  temp = NULL,
  pres = NULL,
  data.struct = 'longcombo',
  id.name = 'id',
  time.name = 'time',
  mass.name,    
  xCH4.name = 'xCH4', 
  xCO2.name = NULL,   
  xN2.name = NULL,    
  headspace = NULL,  
  vol.hs.name = 'vol.hs',
  temp.init = NULL, 
  pres.init = NULL,
  pres.resid = NULL, 
  headcomp = 'N2',  
  cmethod = 'removed',
  imethod = 'linear',
  extrap = FALSE,
  addt0 = TRUE,
  showt0 = TRUE,
  std.message = !quiet,
  check = TRUE,
  temp.std = getOption('temp.std', as.numeric(NA)),
  pres.std = getOption('pres.std', as.numeric(NA)),
  unit.temp = getOption('unit.temp', 'C'),
  unit.pres = getOption('unit.pres', 'atm'),
  quiet = FALSE
  ) 
dat | 
 a data frame with at least bottle identification code, time of measurement (as   | 
comp | 
 (optional) a data frame with the columns bottle identification code; time of measurement, (as   | 
temp | 
 the temperature of biogas just prior to venting.
A length-one numeric vector.
Degrees Celcius by default (see   | 
pres | 
 the absolute pressure of biogas prior to venting.
A length-one numeric vector or a character vector giving the name of the column in   | 
data.struct | 
 the structure of input data. The default of 'longcombo' means bottle mass and biogas composition (if available) are both in   | 
id.name | 
 name of the bottle identification code column in   | 
time.name | 
 name of column containing time data in   | 
mass.name | 
 name of column containing the primary response variable (bottle mass) in   | 
xCH4.name | 
 name of column containing biogas mole fraction of methane in   | 
xCO2.name | 
 name of column containing biogas mole fraction of carbon dioxide in   | 
xN2.name | 
 name of column containing biogas mole fraction of dinitrogen in   | 
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   | 
vol.hs.name | 
 name of column containing headspace volume data in optional   | 
temp.init | 
 the initial headspace temperature.
Optional.
A length-one numeric vector.
Degrees Celcius by default (see   | 
pres.init | 
 the initial headspace pressure.
Optional.
A length-one numeric vector.
Atmospheres by default (see   | 
pres.resid | 
 residual headspace pressure after venting.
Optional.
A length-one numeric vector.
Atmospheres by default (see   | 
headcomp | 
 initial headspace composition as a chemical formula.
Optional, for correcting for change in headspace density.
Mixtures accepted.
Default is   | 
cmethod | 
 method for calculating cumulative methane production.
Use   | 
imethod | 
 method used for interpolation of   | 
extrap | 
 should   | 
addt0 | 
 is the earliest time in   | 
showt0 | 
 should “time zero” rows be returned in the output?
Can be convenient for plotting cumulative volumes.
Only applies if   | 
std.message | 
 should a message with the standard conditions be displayed? 
Default is   | 
check | 
 should input data be checked for unreasonable values (with warnings)? 
Default is   | 
temp.std | 
 standard temperature for presentation of biogas and methane results.
Length one numeric vector.
Default value is 0 degrees C (set in   | 
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   | 
unit.temp | 
 temperature units for   | 
unit.pres | 
 pressure units for   | 
quiet | 
 use to suppress messages. Default is   | 
Using mass loss data from dat and composition data from dat or comp, this function will calculate standardized biogas and methane production for each observation using a grvimetric method.
See reference below for details on the method.
Standard values and units for temperature and pressure can be globally set using the function options.
See stdVol.
a data frame with all the columns originally present in dat, plus others including these:
vBg | 
 Standardized volume of biogas production for individual event.  | 
xCH4 | 
 Calculated mole fraction of methane in biogas.  | 
vCH4 | 
 Standardized volume of methane production for individual event.  | 
cvBg | 
 Standardized cumulative volume of biogas production.  | 
cvCH4 | 
 Standardized cumulative volume of methane production.  | 
rvBg | 
 Production rate of biogas.  | 
rvCH4 | 
 Production rate of methane.  | 
Units are based on units in input data.
Sasha D. Hafner
Hafner, S.D., Rennuit, C., Triolo, J.M., Richards, B.K. 2015. Validation of a simple gravimetric method for measuring biogas production in laboratory experiments. Biomass and Bioenergy 83, 297-301.
calcBgMan,
calcBgVol,
calcBgGD,
summBg,
interp,
stdVol,
options
 
# Combined data frame with mass and composition for \code{data.struct = 'longcombo'} (default).
data('UQGravBiogas')
data('UQGravSetup')
cbg <- calcBgGrav(UQGravBiogas, temp = 35, pres = 1.5,
                   id.name = 'id', time.name = 'day', 
		   mass.name = 'mass.final',
                   xCH4.name = 'xCH4')
head(cbg)
# With separate mass and composition data frames
data('strawMass')
data('strawComp')
data('strawSetup')
cbg0 <- calcBgGrav(strawMass,
                   comp = strawComp, temp = 35, pres = 1.5,
                   data.struct = 'long', id.name = 'bottle',
                   time.name = 'time', mass.name = 'mass',
                   xCH4.name = 'xCH4')
warnings()
cbg <- calcBgGrav(strawMass,
                  comp = strawComp, temp = 35, pres = 1.5,
                  data.struct = 'long', id.name = 'bottle',
                  time.name = 'time', mass.name = 'mass',
                  xCH4.name = 'xCH4', extrap = TRUE)
head(cbg)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.