View source: R/FourHcentroid.R
FourHcentroid | R Documentation |
Calculates the centroid of a set of 4H-indices from bootstrapped samples.
FourHcentroid(boots)
boots |
(Required) Output matrix from the |
FourHcentroid
averages over each column of the output matrix from FourHbootstrap
and prints out the average value of each dimension (\mathcal{U}
, \mathcal{I}
, \mathcal{G}
, \mathcal{L}
) of the 4H-index. It also calculates and prints out the average value for \sigma.
This function outputs a dataframe reporting the average values of each dimension of the 4H-index, and the average value of \sigma
.
#Test with enterotype dataset
library(phyloseq)
data(enterotype)
#Covert the OTU table to reads, rather than fractional abundances
otu_table(enterotype)<-round(10000*otu_table(enterotype))
#Randomly assign host classes (these should be known in a real hybrid microbiome dataset)
#The two parent species are assigned '1' and '3' respectively, the hybrid is assigned '2'
hybrid_status<-sample(1:3,280, replace=TRUE)
#Bootstrap the dataset
boot_samples<-FourHbootstrap(enterotype,hybrid_status,0.5,5,10)
#Find the centroid of the bootstrap samples
FourHcentroid(boot_samples)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.