get_alphaindex | R Documentation |
calculate the alpha index (Obseve,Chao1,Shannon,Simpson) of sample
with diversity
get_alphaindex(obj, ...)
## S4 method for signature 'matrix'
get_alphaindex(obj, mindepth, sampleda, force = FALSE, ...)
## S4 method for signature 'data.frame'
get_alphaindex(obj, ...)
## S4 method for signature 'integer'
get_alphaindex(obj, ...)
## S4 method for signature 'numeric'
get_alphaindex(obj, ...)
## S4 method for signature 'phyloseq'
get_alphaindex(obj, ...)
obj |
object, data.frame of (nrow sample * ncol taxonomy(feature)) or phyloseq. |
... |
additional arguments. |
mindepth |
numeric, Subsample size for rarefying community. |
sampleda |
data.frame,sample information, row sample * column factors. |
force |
logical whether calculate the alpha index even the count of otu is not rarefied, default is FALSE. If it is TRUE, meaning the rarefaction is not be performed automatically. |
data.frame contained alpha Index.
Shuangbin Xu
## Not run:
otudafile <- system.file("extdata", "otu_tax_table.txt",
package="MicrobiotaProcess")
otuda <- read.table(otudafile, sep="\t",
header=TRUE, row.names=1,
check.names=FALSE, skip=1, comment.char="")
otuda <- otuda[sapply(otuda, is.numeric)] %>% t() %>%
data.frame(check.names=FALSE)
set.seed(1024)
alphatab <- get_alphaindex(otuda)
head(as.data.frame(alphatab))
data(test_otu_data)
class(test_otu_data)
test_otu_data %<>% as.phyloseq()
class(test_otu_data)
set.seed(1024)
alphatab2 <- get_alphaindex(test_otu_data)
head(as.data.frame(alphatab2))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.