ggiNEXT3D: ggplot2 extension for an iNEXT object

Description Usage Arguments Value Examples

View source: R/MainFun.r

Description

ggiNEXT3D: the ggplot extension for iNEXT3D Object to plot sample-size- and coverage-based rarefaction/extrapolation curves along with a bridging sample completeness curve

Usage

1
ggiNEXT3D(outcome, type = 1:3, facet.var = "Assemblage", color.var = "Order.q")

Arguments

type

three types of plots: sample-size-based rarefaction/extrapolation curve (type = 1); sample completeness curve (type = 2); coverage-based rarefaction/extrapolation curve (type = 3).

facet.var

create a separate plot for each value of a specified variable: no separation
(facet.var="None"); a separate plot for each diversity order (facet.var="Order.q"); a separate plot for each assemblage (facet.var="Assemblage"); a separate plot for each combination of order x assemblage (facet.var="Both").

color.var

create curves in different colors for values of a specified variable: all curves are in the same color (color.var="None"); use different colors for diversity orders (color.var="Order.q"); use different colors for sites (color.var="Assemblage"); use different colors for combinations of order x assemblage (color.var="Both").

x

an iNEXT object computed by iNEXT.

...

other arguments passed on to methods. Not currently used.

Value

a ggplot2 object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
## example for abundance based data (list of vector)
# diversity = 'TD'
data(spider)
out1 <- iNEXT3D(spider, diversity = 'TD', q = c(0,1,2), datatype = "abundance")
ggiNEXT3D(out1, facet.var = "Assemblage")

# diversity = 'PD'
data(data.abu)
data <- data.abu$data
tree <- data.abu$tree
out2 <- iNEXT3D(data, diversity = 'PD', q = 0, datatype = "abundance", nboot = 30, PDtree = tree)
ggiNEXT3D(out2, type = c(1, 3))

# diversity = 'FD' & FDtype = 'tau_values'
data(FunDdata.abu)
data <- FunDdata.abu$data
distM <-  FunDdata.abu$dij
out3 <- iNEXT3D(data[,1], diversity = 'FD', datatype = "abundance", nboot = 0, FDdistM = distM, FDtype = 'tau_values')
ggiNEXT3D(out3)

# diversity = 'FD' & FDtype = 'AUC'
data(FunDdata.abu)
data <- FunDdata.abu$data
distM <-  FunDdata.abu$dij
out4 <- iNEXT3D(data = data[,2], diversity = 'FD', datatype = "abundance", nboot = 0, FDdistM = distM)
ggiNEXT3D(out4)

## example for incidence-based data
# diversity = 'TD'
data(ant)
t <- round(seq(10, 500, length.out = 20))
out5 <- iNEXT3D(ant$h500m, diversity = 'TD', q = 1, datatype = "incidence_freq", size = t)
ggiNEXT3D(out5)

# diversity = 'PD'
data(data.inc)
data <- data.inc$data
tree <- data.inc$tree
nT <- data.inc$nT
out6 <- iNEXT3D(data, diversity = 'PD', q = c(0, 1, 2), datatype = "incidence_raw", nT = nT, PDtree = tree)
ggiNEXT3D(out6, facet.var = "Order.q", color.var = "Assemblage")

# diversity = 'FD' & FDtype = 'tau_values'
data(FunDdata.inc)
data <- FunDdata.inc$data
distM <-  FunDdata.inc$dij
out7 <- iNEXT3D(data, diversity = 'FD', datatype = "incidence_freq", FDdistM = distM, FDtype = 'tau_values')
ggiNEXT3D(out7)

# diversity = 'FD' & FDtype = 'AUC'
data(FunDdata.inc)
data <- FunDdata.inc$data
distM <-  FunDdata.inc$dij
out8 <- iNEXT3D(data, diversity = 'FD', datatype = "incidence_freq", nboot = 0, FDdistM = distM)
ggiNEXT3D(out8)

KaiHsiangHu/iNEXT3D documentation built on July 18, 2021, 8:11 p.m.