ggiNEXT: ggplot2 extension for an iNEXT object

View source: R/ggiNEXT.R

ggiNEXTR Documentation

ggplot2 extension for an iNEXT object

Description

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

Usage

ggiNEXT(
  x,
  type = 1,
  se = TRUE,
  facet.var = "None",
  color.var = "Assemblage",
  grey = FALSE
)

## S3 method for class 'iNEXT'
ggiNEXT(
  x,
  type = 1,
  se = TRUE,
  facet.var = "None",
  color.var = "Assemblage",
  grey = FALSE
)

## Default S3 method:
ggiNEXT(x, ...)

Arguments

x

an iNEXT object computed by iNEXT.

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).

se

a logical variable to display confidence interval around the estimated sampling curve.

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").

grey

a logical variable to display grey and white ggplot2 theme.

...

other arguments passed on to methods. Not currently used.

Value

a ggplot2 object

Examples

# single-assemblage abundance data
data(spider)
out1 <- iNEXT(spider$Girdled, q=0, datatype="abundance")
ggiNEXT(x=out1, type=1)
ggiNEXT(x=out1, type=2)
ggiNEXT(x=out1, type=3)

## Not run: 
# single-assemblage incidence data with three orders q
data(ant)
size <- round(seq(10, 500, length.out=20))
y <- iNEXT(ant$h500m, q=c(0,1,2), datatype="incidence_freq", size=size, se=FALSE)
ggiNEXT(y, se=FALSE, color.var="Order.q")

# multiple-assemblage abundance data with three orders q
z <- iNEXT(spider, q=c(0,1,2), datatype="abundance")
ggiNEXT(z, facet.var="Assemblage", color.var="Order.q")
ggiNEXT(z, facet.var="Both", color.var="Both")

## End(Not run)

iNEXT documentation built on Aug. 30, 2022, 1:09 a.m.