View source: R/alter_functions.R
| alter_whatever | R Documentation |
BGFA set of functions that allow to alter data in each layer of a BGF.
alter_whatever(x, layer, what, value, ID = NULL, feedback = FALSE)
alter_BG_measurement(
x,
reactor_id,
time_id,
col,
measurement,
ID = NULL,
feedback = FALSE
)
x |
a |
layer |
a |
what |
a |
value, measurement |
either a |
ID |
defaults to |
feedback |
|
reactor_id |
a |
time_id |
a |
col |
a |
The two functions alter_whatever and alter_BG_measurement can be used to change information in each layer of a BGF.
The function alter_whatever can be used to change data in the ExpParam or metaData layer.
The function alter_BG_measurement changes a single entry in the BioGasData layer of the BGF.
This entry can be selected by providing the name of the reactor for which a measurement should be changed, together with the time after fermentation start when the measurement was acquired.
Alternatively, the row number in the BioGasData layer of that measurement can be provided to 'ID'.
a BGF
# create an example BGF
myBGF <- from_AMPTSV2_report(
ReactorLayout = c("2*Blank","Cellulose","3*neg ctrl","3*FR1","3*FR2","3*FR3"),
BlankLabel = "Blank",
name = "Test",
InocToSubRatio=2,
ProcessTemp = 52,
path = base::system.file("extdata","AMPTSV2.csv",package = "bgfanalyzer")
)
# change name to 'newName'
myBGF <- alter_whatever(myBGF,"ExpParam","name","newName",feedback=TRUE)
# exclude reactor 5,6 and 7
myBGF <- alter_whatever(myBGF,"metaData","Excluded",TRUE,c("R5","R6","R7"),feedback=TRUE)
# exclude all reactors
myBGF <- alter_whatever(myBGF,"metaData","Excluded",TRUE)
# change the 'product' column of reactor 1 at time 0 to 7777
myBGF <- alter_BG_measurement(myBGF,"R1",0,"production",7777)
# do the same for reactor 2 but index via 'ID'
myBGF <- alter_BG_measurement(myBGF,ID=2,col="production",measurement=7777)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.