| sample_sums | R Documentation |
Summarize the taxa observations in each sample.
sample_sums(biom, rank = -1, sort = NULL, unc = "singly")
sample_apply(biom, FUN, rank = -1, sort = NULL, unc = "singly", ...)
biom |
An rbiom object, such as from |
rank |
What rank(s) of taxa to display. E.g. |
sort |
Sort the result. Options: |
unc |
How to handle unclassified, uncultured, and similarly ambiguous taxa names. Options are:
Abbreviations are allowed. Default: |
FUN |
The function to apply to each column of |
... |
Optional arguments to |
For sample_sums, A named numeric vector of the number of
observations in each sample. For sample_apply, a named vector or
list with the results of FUN. The names are the taxa IDs.
Other samples:
pull.rbiom()
Other rarefaction:
rare_corrplot(),
rare_multiplot(),
rare_stacked(),
rarefy(),
rarefy_cols()
Other taxa_abundance:
taxa_boxplot(),
taxa_clusters(),
taxa_corrplot(),
taxa_heatmap(),
taxa_stacked(),
taxa_stats(),
taxa_sums(),
taxa_table()
library(rbiom)
library(ggplot2)
sample_sums(hmp50, sort = 'asc') %>% head()
# Unique OTUs and "cultured" classes per sample
nnz <- function (x) sum(x > 0) # number of non-zeroes
sample_apply(hmp50, nnz, 'otu') %>% head()
sample_apply(hmp50, nnz, 'class', unc = 'drop') %>% head()
# Number of reads in each sample's most abundant family
sample_apply(hmp50, base::max, 'f', sort = 'desc') %>% head()
ggplot() + geom_histogram(aes(x=sample_sums(hmp50)), bins = 20)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.