View source: R/move_fermentations.R
| trim_FR_time | R Documentation |
BGF by timeThe function allows to remove data points of individual or all fermentations based on the fermentation/ observation time ('time' column in BiGasData layer of a BGF).
The user can either remove data points later than a specified 'time' value, or subtract a specified value from each value in the 'time' column and afterwards optionally remove the resulting times < 0.
trim_FR_time(x, value, mode = "all", left_end = TRUE, cut_left = TRUE)
x |
a |
value |
a |
mode |
a |
left_end |
|
cut_left |
|
a BGF
# create example BGF
myBGF <- from_AMPTSV2_report(
ReactorLayout = c("2*Meso","Cellulose","2*S1 ctrl","2*S1 7d","2*S1 4d",
"2*S2 ctrl","2*S2 4d","2*S2 6d"),
BlankLabel = "Meso",
name = "myBGF",
ProcessTemp = 42,
path = base::system.file("extdata","AMPTSV2.csv",package = "bgfanalyzer"),
InocToSubRatio = 2,
feedback = TRUE)
# BioGasData has 735 rows
nrow(myBGF$BioGasData)
# remove all data before day 30
myBGF <- trim_FR_time(myBGF,value= 30)
# BioGasData has now only 285 rows
nrow(myBGF$BioGasData)
# remove all data after day 15
myBGF <- trim_FR_time(myBGF,value= 15,left_end=FALSE,cut_left=FALSE)
# BioGasData has now only 225 rows
nrow(myBGF$BioGasData)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.