extract_table is a generic function which extracts a table from a metabarlist object.

extract_table(metabarlist, table = extract_table_methods)

Arguments

metabarlist

a metabarlist object

table

the table required for extraction. Can be one of `reads`, `motus`, `pcrs`, or `samples`

Value

a numeric matrix `reads` or a data frame `motus`, `pcrs`, or `samples`

Details

All metabarlist objects are composed of four different tables that can be extracted as single table with this function.

Author

Lucie Zinger

Examples


data(soil_euk)

reads <- extract_table(soil_euk, "reads")
#> Warning: Some PCRs in metabarlist have a number of reads of zero in table `reads`!
motus <- extract_table(soil_euk, "motus")
#> Warning: Some PCRs in metabarlist have a number of reads of zero in table `reads`!

all(colnames(reads) == rownames(motus))
#> [1] TRUE
is.matrix(reads)
#> [1] TRUE
is.data.frame(motus)
#> [1] TRUE