get_layer: Extract information from a BGF

View source: R/get_functions.R

get_layerR Documentation

Extract information from a BGF

Description

A set of functions that can be used to extract various information from a BGF.

Usage

get_layer(x, layer, feedback = FALSE)

get_whatever(x, layer, what, feedback = FALSE)

get_MeasurementType(x, feedback = FALSE)

get_ReactorLayout(x, feedback = FALSE)

get_BlankLabel(x, feedback = FALSE)

get_Excluded(x, feedback = FALSE)

get_blanks(x, feedback = FALSE)

get_yield_summary(x, Excluded = FALSE, feedback = TRUE)

Arguments

x

a BGF

layer

a layer of a BGF; either 'ExpParam', 'metaData' or 'BioGasData'

feedback

logic, if TRUE the function will print a feedback to the R console

what

a character referring either to a list entry of the ExpParam layer, or a column of the metaData or BioGasData layer of a BGF

Excluded

logic if TRUE, excluded reactors are not included in the summary. Default = FALSE

Details

The functions get_MeasurementType, get_ReactorLayout, get_BlankLabel,get_Excluded and get_blanks are wrapper for get_whatever and extract frequently needed information from a BGF.

The function get_whatever internally calls get_layer to extract any layer from a BGF, and subsequently return only a single list entry or a data.frame column.

The function get_yield_summary returns a data.frame if a yield summary was generated for the BGF via summarize_yield.

Value

get_layer returns a either a data.farme or list

get_whatever returns a either a data.farme column or list entry

get_MeasurementType returns a character

get_ReactorLayout returns a factor

get_BlankLabel returns a factor

get_Excluded returns a character

get_blanks returns a character

get_yield_summary returns a data.frame

Examples

# create an example BGF
myBGF<-BGF(LETTERS[1:5],"A","myBGF",52,2,"manuel")

# extract 'ExpParam' layer
ExpParam <-get_layer(myBGF,"ExpParam",TRUE)

# extract 'metaData' layer
metaData <-get_layer(myBGF,"metaData",TRUE)

# extract 'BioGasData' layer
BioGasData <-get_layer(myBGF,"BioGasData",TRUE)

# extract 'name'-attribute
get_whatever(myBGF,"ExpParam","name")

# extract 'MeasurmentType'-attribute
get_MeasurementType(myBGF)

# extract the reactor layout
get_ReactorLayout(myBGF)

# extract the Blank label
get_BlankLabel(myBGF)

# Exclude reactor 1 and 5
myBGF$metaData$Excluded[c(1,5)] <- TRUE

# extract the excluded reactors
get_Excluded(myBGF)

# extract names of blank reactors
get_blanks(myBGF)

# create a second example BGF
myBGF2<-from_AMPTSV2_report(
        ReactorLayout = c("2*Blank","Cellulose","3*neg ctrl","3*FR1","3*FR2","3*FR3"),
        BlankLabel = "Blank",
        name = "myBGF2",
        InocToSubRatio = 2,
        ProcessTemp = 52,
        path = base::system.file("extdata","AMPTSV2.csv",package = "bgfanalyzer"))

# extract yield summary
get_yield_summary(myBGF2)


bgfanalyzer documentation built on Sept. 26, 2026, 5:07 p.m.