Description Usage Arguments Value Examples
View source: R/ecos_prepare_by_trait.R
Starting from a taxonomic species abundance matrix, produces a new matrix, with features now collpased vesions of the species where the collapsing is done by trait level information. Binning is done on the species based on their trait level similarity- where similarity is determined by a dendogram produced by hierarchical clustering.
1 | ecos_prepare_by_trait(counts, traits, prop_div = 0.3)
|
counts |
The abundance counts matrix with samples/sites along the rows and the species/features along the columns. |
traits |
A distance metric between species - a square matrix with species along rows and columns and the diagonal element equal to 0. |
prop_div |
The proportion of the original counts matrix diversity at which to cut the dendrogram. |
The output is a counts matrix with the columns corresponding to the species bins - each bin designated here by the first species entry into the bin.
1 2 3 4 5 6 7 8 | data(himalayan_birds)
species_metadata <- pData(featureData(himalayan_birds))
taxonomic_counts <- t(exprs(himalayan_birds))
bill_traits <- as.matrix(dist(scale(species_metadata[,c(1:3)])))
counts_bill_traits <- ecos_prepare_by_trait(counts = taxonomic_counts,
traits = bill_traits,
prop_div=0.3)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.