Skip to content

Latest commit

 

History

History
38 lines (30 loc) · 1.81 KB

div_profile.md

File metadata and controls

38 lines (30 loc) · 1.81 KB

div_profile()

Last update: hilldiv 1.5.0

Create diversity profile vector (single sample or system) or tables (multiple samples or groups) from count tables.

Arguments

Arguments Description
count A vector or a matrix indicating the (relative) OTU/ASV counts of one or multiple samples. If a matrix is provided, columns must refer to samples and rows to OTUs.
qvalues A vector of sequential orders of diversity (default from 0 to 5). order=seq(from = 0, to = 5, by = (0.1))
tree A tree of class 'phylo'. The tip labels must match the names of the vector values (if one sample) or matrix rows (if multiple samples). Use the function match.data() if the OTU names do not match.
values If 'TRUE' the Hill numbers for each order of diversity for each sample or group (if hierarchy table is provided) are printed on screen. values="FALSE".
hierarchy A two-column matrix indicating the relation between samples (first column) and groups (second column).
level Whether to compute alpha or gamma diversities of the system or the groups specified in the hierarchy table.

Examples

data(bat.diet.otutable)
data(bat.diet.tree)
data(bat.diet.hierarchy)

#One sample example
bat.diet.sample <- bat.diet.otutable[,1]
div_profile(count=bat.diet.sample,qvalues=seq(from = 0, to = 5, by = (0.1)))

#One sample example (phylogenetic Hill numbers)
names(bat.diet.sample) <- rownames(bat.diet.otutable)
div_profile(count=bat.diet.sample,qvalues=seq(from = 0, to = 5, by = (0.1)),tree=bat.diet.tree)

#Multiple samples
div_profile(bat.diet.otutable)

#Multiple groups (gamma diversity)
div_profile(bat.diet.otutable,hierarchy=bat.diet.hierarchy,level="gamma")

#Multiple groups (alpha diversity)
div_profile(bat.diet.otutable,hierarchy=bat.diet.hierarchy,level="alpha")