accumresult: Alternative Species Accumulation Curve Results

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Provides alternative methods of obtaining species accumulation results than provided by functions specaccum and plot.specaccum (vegan).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
accumresult(x, y="", factor="", level, scale="", method="exact", permutations=100,
    conditioned=T, gamma="boot", ...)

accumplot(xr, addit=F, labels="", col=1, ci=2, pch=1, type="p", cex=1, 
    xlim=c(1, xmax), ylim=c(1, rich),
    xlab="sites", ylab="species richness", cex.lab=1, cex.axis=1, ...)

accumcomp(x, y="", factor, scale="", method="exact", permutations=100,
    conditioned=T, gamma="boot", plotit=T, labelit=T, legend=T, rainbow=T,
    xlim=c(1, max), ylim=c(0, rich),type="p", xlab="sites",
    ylab="species richness", cex.lab=1, cex.axis=1, ...)

Arguments

x

Community data frame with sites as rows, species as columns and species abundance as cell values.

y

Environmental data frame.

factor

Variable of the environmental data frame that defines subsets to calculate species accumulation curves for.

level

Level of the variable to create the subset to calculate species accumulation curves.

scale

Continuous variable of the environmental data frame that defines the variable that scales the horizontal axis of the species accumulation curves.

method

Method of calculating the species accumulation curve (as in function specaccum). Method "collector" adds sites in the order they happen to be in the data, "random" adds sites in random order, "exact" finds the expected (mean) species richness, "coleman" finds the expected richness following Coleman et al. 1982, and "rarefaction" finds the mean when accumulating individuals instead of sites.

permutations

Number of permutations to calculate the species accumulation curve (as in function specaccum).

conditioned

Estimation of standard deviation is conditional on the empirical dataset for the exact SAC (as in function specaccum).

gamma

Method for estimating the total extrapolated number of species in the survey area (as in specaccum).

addit

Add species accumulation curve to an existing graph.

xr

Result from specaccum or accumresult.

col

Colour for drawing lines of the species accumulation curve (as in function plot.specaccum).

labels

Labels to plot at left and right of the species accumulation curves.

ci

Multiplier used to get confidence intervals from standard deviatione (as in function plot.specaccum).

pch

Symbol used for drawing the species accumulation curve (as in function points).

type

Type of plot (as in function plot).

cex

Character expansion factor (as in function plot).

xlim

Limits for the X = horizontal axis.

ylim

Limits for the Y = vertical axis.

xlab

Label for the X = horizontal axis (as in function title).

ylab

Label for the Y = vertical axis (as in function title).

cex.lab

The magnification to be used for X and Y labels relative to the current setting of cex. (as in function par).

cex.axis

The magnification to be used for axis annotation relative to the current setting of cex (as in function par).

plotit

Plot the results.

labelit

Label the species accumulation curves with the levels of the categorical variable.

legend

Add the legend (you need to click in the graph where the legend needs to be plotted).

rainbow

Use rainbow colouring for the different curves.

...

Other items passed to function specaccum or plot.specaccum.

Details

These functions provide some alternative methods of obtaining species accumulation results, although function specaccum is called by these functions to calculate the actual species accumulation curve.

Functions accumresult and accumcomp allow to calculate species accumulation curves for subsets of the community and environmental data sets. Function accumresult calculates the species accumulation curve for the specified level of a selected environmental variable. Method accumcomp calculates the species accumulation curve for all levels of a selected environmental variable separatedly. Both methods allow to scale the horizontal axis by multiples of the average of a selected continuous variable from the environmental dataset (hint: add the abundance of each site to the environmental data frame to scale accumulation results by mean abundance).

Functions accumcomp and accumplot provide alternative methods of plotting species accumulation curve results, although function plot.specaccum is called by these functions. When you choose to add a legend, make sure that you click in the graph on the spot where you want to put the legend.

Value

The functions provide alternative methods of obtaining species accumulation curve results, although results are similar as obtained by functions specaccum and plot.specaccum.

Author(s)

Roeland Kindt (World Agroforestry Centre)

References

Kindt, R. & Coe, R. (2005) Tree diversity analysis: A manual and software for common statistical methods for ecological and biodiversity studies.

https://www.worldagroforestry.org/output/tree-diversity-analysis

https://rpubs.com/Roeland-KINDT

See Also

accumcomp.long

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
library(vegan)
data(dune.env)
data(dune)
dune.env$site.totals <- apply(dune,1,sum)
Accum.1 <- accumresult(dune, y=dune.env, scale='site.totals', method='exact', conditioned=TRUE)
Accum.1
accumplot(Accum.1)

Accum.2 <- accumcomp(dune, y=dune.env, factor='Management', method='exact', 
    legend=FALSE, conditioned=TRUE, scale='site.totals')
## CLICK IN THE GRAPH TO INDICATE WHERE THE LEGEND NEEDS TO BE PLACED FOR
## OPTION WHERE LEGEND=TRUE (DEFAULT).

## Not run: 
# ggplot2 plotting method

data(warcom)
data(warenv)

Accum.3 <- accumcomp(warcom, y=warenv, factor='population', 
    method='exact', conditioned=F, plotit=F)

library(ggplot2)

# possibly need for extrafont::loadfonts(device="win") to have Arial
# as alternative, use library(ggThemeAssist)
BioR.theme <- theme(
        panel.background = element_blank(),
        panel.border = element_blank(),
        panel.grid = element_blank(),
        axis.line = element_line("gray25"),
        text = element_text(size = 12, family="Arial"),
        axis.text = element_text(size = 10, colour = "gray25"),
        axis.title = element_text(size = 14, colour = "gray25"),
        legend.title = element_text(size = 14),
        legend.text = element_text(size = 14),
        legend.key = element_blank())

accum.long3 <- accumcomp.long(Accum.3, ci=NA, label.freq=5)

plotgg1 <- ggplot(data=accum.long3, aes(x = Sites, y = Richness, ymax =  UPR, ymin= LWR)) + 
    scale_x_continuous(expand=c(0, 1), sec.axis = dup_axis(labels=NULL, name=NULL)) +
    scale_y_continuous(sec.axis = dup_axis(labels=NULL, name=NULL)) +
    geom_line(aes(colour=Grouping), size=2) +
    geom_point(data=subset(accum.long3, labelit==TRUE), 
        aes(colour=Grouping, shape=Grouping), size=5) +
    geom_ribbon(aes(colour=Grouping), alpha=0.2, show.legend=FALSE) + 
    BioR.theme +
    scale_color_brewer(palette = "Set1") +
    labs(x = "Trees", y = "Loci", colour = "Population", shape = "Population")

plotgg1

## End(Not run) # dontrun

Example output

sh: 1: cannot create /dev/null: Permission denied
Loading required package: tcltk
Loading required package: vegan
Loading required package: permute
Loading required package: lattice
This is vegan 2.5-7
Loading required package: vegan3d
Loading required package: rgl
sh: 1: cannot create /dev/null: Permission denied
Registered S3 methods overwritten by 'lme4':
  method                          from
  cooks.distance.influence.merMod car 
  influence.merMod                car 
  dfbeta.influence.merMod         car 
  dfbetas.influence.merMod        car 
BiodiversityR 2.12-2: Use command BiodiversityRGUI() to launch the Graphical User Interface; 
to see changes use BiodiversityRGUI(changeLog=TRUE, backward.compatibility.messages=TRUE)

Warning messages:
1: no DISPLAY variable so Tk is not available 
2: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display
3: 'rgl.init' failed, running with 'rgl.useNULL = TRUE'. 
Species Accumulation Curve
Accumulation method: exact
Call: specaccum(comm = x, method = method, permutations = permutations,      conditioned = conditioned, gamma = gamma) 

                                                                              
Sites    34.2500 68.5000 102.7500 137.0000 171.2500 205.5000 239.7500 274.0000
Richness  9.8500 15.1105  18.5105  20.9375  22.7543  24.1496  25.2396  26.1035
sd        2.3511  1.8764   1.5723   1.4470   1.3902   1.3530   1.3165   1.2749
                                                                       
Sites    308.2500 342.5000 376.7500 411.0000 445.2500 479.5000 513.7500
Richness  26.7982  27.3650  27.8340  28.2275  28.5620  28.8496  29.0996
sd         1.2282   1.1763   1.1193   1.0565   0.9874   0.9116   0.8287
                                                
Sites    548.0000 582.2500 616.5000 650.7500 685
Richness  29.3191  29.5140  29.6895  29.8500  30
sd         0.7381   0.6334   0.5140   0.3571   0

BiodiversityR documentation built on April 20, 2021, 5:07 p.m.