draw_dis_spe: 'draw_dis_spe' plots the contribution of each species/node to...

Description Usage Arguments Value Examples

View source: R/funs.R

Description

draw_dis_spe plots the contribution of each species/node to dissimilarity (Jaccard-type dissimilarity and Sorensen-type dissimilarity).

Usage

1
draw_dis_spe(x, title_name, type = "tax")

Arguments

x

a merged table of output values with three columns corresponding to output for q = 0, 1, 2. See example for details.

title_name

the title name of plot (Usually the Jaccard-type dissimilarity or Sorensen-type dissimilarity). See example for details.

type

a string specifying the type of contribution: "tax" for taxonomic and "phy" for phylogenetic

Value

a ggplot2 object showing the contribution of each species/node.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
#Taxonomic analysis example
data(Alpine)
out0 <- dis1(x = Alpine, q = 0, type = "tax")
out1 <- dis1(x = Alpine, q = 1, type = "tax")
out2 <- dis1(x = Alpine, q = 0, type = "tax")
tax_UqN_r <- cbind(out0[, 1], out1[, 1], out2[, 1])
tax_CqN_r <- cbind(out0[, 2], out1[, 2], out2[, 2])
draw_dis_spe(tax_UqN_r, "Jaccard-type taxonomic dissimilarity")
draw_dis_spe(tax_CqN_r, "Sorensen-type taxonomic dissimilarity")
#Phylogenetic analysis example
data(Alpine)
data(tree_Alpine)
out0 <- dis1(x = Alpine, q = 0, type = "phy", tree = tree_Alpine)
out1 <- dis1(x = Alpine, q = 1, type = "phy", tree = tree_Alpine)
out2 <- dis1(x = Alpine, q = 2, type = "phy", tree = tree_Alpine)
phy_UqN_r <- cbind(out0[, 1], out1[, 1], out2[, 1])
phy_CqN_r <- cbind(out0[, 2], out1[, 2], out2[, 2])
draw_dis_spe(phy_UqN_r, "Jaccard-type phylogenetic dissimilarity", type = "phy")
draw_dis_spe(phy_CqN_r, "Sorensen-type phylogenetic dissimilarity", type = "phy")

YanHanChen/Evenness documentation built on Feb. 1, 2020, 12:53 a.m.