Running examples in ‘biogas-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: summBg
> ### Title: Summarise and Normalise Cumulative Methane Production
> ### Aliases: summBg
> ### Keywords: univar manip chron
> 
> ### ** Examples
> 
> data("vol")
> data("comp") 
> data("setup") 
> 
> # First need to calculate cumulative methane production data
> cum.prod <- cumBg(vol, comp = comp, temp = 20, pres = 1, 
+                   time.name = "days", extrap = TRUE)
Biogas composition is interpolated.
Working with volume data, applying volumetric method.
Using a standard pressure of 1 atm and standard temperature of 0 C for standardizing volume.
> 
> head(cum.prod)
   id           date.time days vol      xCH4 temperature pressure      vBg
1 2_1                <NA> 0.00  NA        NA          NA       NA   0.0000
2 2_1 2014-06-07 13:00:00 1.98 393 0.7104731          20        1 357.7102
3 2_1 2014-06-08 13:00:00 2.98 260 0.7104731          20        1 236.6531
4 2_1 2014-06-09 13:00:00 3.98 245 0.7104731          20        1 223.0000
5 2_1 2014-06-10 13:00:00 4.98 225 0.7104731          20        1 204.7959
6 2_1 2014-06-11 13:00:00 5.98 200 0.7104731          20        1 182.0408
      vCH4      cvBg    cvCH4     rvBg    rvCH4
1   0.0000    0.0000   0.0000       NA       NA
2 254.4650  357.7102 254.4650 180.6617 128.5177
3 168.3483  594.3633 422.8133 236.6531 168.3483
4 158.6359  817.3632 581.4492 223.0000 158.6359
5 145.6861 1022.1592 727.1353 204.7959 145.6861
6 129.4987 1204.2000 856.6340 182.0408 129.4987
> 
> # Cumulative methane production (default) at 30 d 
> # Uses default names for some columns
> summBg(vol = cum.prod, setup = setup, time.name = "days", when = 30)
Response variable (volume) is cum.prod$cvCH4.
Inoculum contribution not subtracted.
No normalization by substrate mass.
  descrip days     mean       se       sd n
1       A   30 1751.342 24.00315 41.57468 3
2       B   30 2263.219 28.88509 50.03045 3
3   cellu   30 4015.498 36.29163 62.85895 3
4    inoc   30 1715.365 20.90955 36.21640 3
> 
> # Or total cumulative biogas
> summBg(vol = cum.prod, setup = setup, time.name = "days", 
+        vol.name = "cvBg", when = 30)
Response variable (volume) is cum.prod$cvBg.
Inoculum contribution not subtracted.
No normalization by substrate mass.
  descrip days     mean       se        sd n
1       A   30 2524.709 26.88165  46.56039 3
2       B   30 3371.789 64.45903 111.64631 3
3   cellu   30 6732.648 40.25114  69.71702 3
4    inoc   30 2470.238 37.65794  65.22546 3
> 
> # Cumulative CH4 only, subtract inoculum contribution
> summBg(vol = cum.prod, setup = setup, time.name = "days", 
+        inoc.name = "inoc", inoc.m.name = "minoc", when = 30)
Response variable (volume) is cum.prod$cvCH4.
Inoculum contribution subtracted based on setup$minoc.
No normalization by substrate mass.
  descrip days      mean       se       sd n
1       A   30  605.0316 19.18513 33.22962 3
2       B   30  665.2546 39.59385 68.57855 3
3   cellu   30 2302.6447 39.64097 68.66017 3
> 
> # And normalise by mvs.sub column (mass of substrate VS here) (so the result is BMP)
> summBg(vol = cum.prod, setup = setup, time.name = "days", 
+        inoc.name = "inoc", inoc.m.name = "minoc", when = 30, 
+        norm.name = "mvs.sub")
Response variable (volume) is cum.prod$cvCH4.
Inoculum contribution subtracted based on setup$minoc.
Response normalized by setup$mvs.sub.
  descrip days     mean       se       sd n
1       A   30 157.7967 4.925421  8.53108 3
2       B   30 124.9984 7.570106 13.11181 3
3   cellu   30 418.8466 7.785209 13.48438 3
> 
> # Same example, but return results for three times
> summBg(vol = cum.prod, setup = setup, time.name = "days", 
+        inoc.name = "inoc", inoc.m.name = "minoc", when = c(10, 30, 60), 
+        norm.name = "mvs.sub")
Error in if (!pdwhen & show.rates) { : the condition has length > 1
Calls: summBg
Execution halted