View source: R/amp_merge_replicates.R
amp_merge_replicates | R Documentation |
Aggregates read counts in replicate samples by calculating the mean abundances of OTU's.
amp_merge_replicates(data, merge_var, round = NULL)
amp_mergereplicates(data, merge_var, round = NULL)
data |
(required) Data list as loaded with |
merge_var |
Variable in the sample metadata that defines the sample groups, see examples. |
round |
If the read counts in |
An object of class ampvis2
Kasper Skytte Andersen ksa@bio.aau.dk
# load data
d <- amp_load(ampvis2::example_otutable, ampvis2::example_metadata)
d
# add a grouping variable to the sample metadata defining the groups of sample replicates
d$metadata$group <- c("group1", "group1", "group2", "group2", "group3", "group4", NA, NA)
d$metadata
# merge by "group" rounding up the resulting values
dmerged <- amp_mergereplicates(d,
merge_var = "group",
round = "up"
)
dmerged$metadata
dmerged
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.