taxa_clusters {rbiom} | R Documentation |
Cluster samples by taxa abundances k-means.
Description
Cluster samples by taxa abundances k-means.
Usage
taxa_clusters(biom, rank = ".otu", k = 5, ...)
Arguments
biom |
An rbiom object, such as from |
rank |
Which taxa rank to use. E.g. |
k |
Number of clusters. Default: |
... |
Passed on to |
Value
A numeric factor assigning samples to clusters.
See Also
Other taxa_abundance:
sample_sums()
,
taxa_boxplot()
,
taxa_corrplot()
,
taxa_heatmap()
,
taxa_stacked()
,
taxa_stats()
,
taxa_sums()
,
taxa_table()
Other clustering:
bdiv_clusters()
Examples
library(rbiom)
biom <- rarefy(hmp50)
biom$metadata$otu_cluster <- taxa_clusters(biom)
pull(biom, 'otu_cluster')[1:10]
bdiv_ord_plot(biom, layers = "p", stat.by = "otu_cluster")
[Package rbiom version 2.2.1 Index]