rankabundance: Rank Abundance Curves

Description Usage Arguments Details Value Author(s) References Examples

Description

Provides methods of calculating rank-abundance curves.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
rankabundance(x, y="", factor="", level, digits=1, t=qt(0.975, df=n-1))

rankabunplot(xr, addit=F, labels="", scale="abundance", scaledx=F, type="o",
    xlim=c(min(xpos), max(xpos)),
    ylim=c(0, max(x[,scale])),
    specnames=c(1:5), srt=0, ...)

rankabuncomp(x, y="", factor, return.data=T, specnames=c(1:3),
    scale="abundance", scaledx=F, type="o", rainbow=T,
    legend=T, xlim=c(1, max1), ylim=c(0, max2), ...)

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 rank abundance curves for.

level

Level of the variable to create the subset to calculate rank abundance curves.

digits

Number of digits in the results.

t

t-value to calculate confidence interval limits for the species proportion for cluster sampling (following Hayek and Buzas 1997).

xr

Result from rankabundance.

addit

Add rank abundance curve to an existing graph.

labels

Labels to plot at left of the rank abundance curves.

scale

Method of scaling the vertical axis. Method "abundance" uses abundance, "proportion" uses proportional abundance (species abundance / total abundance), "logabun" calculates the logarithm of abundance using base 10 and "accumfreq" accumulates the proportional abundance.

scaledx

Scale the horizontal axis to 100 percent of total number of species.

type

Type of plot (as in function plot)

xlim

Limits for the horizontal axis.

ylim

Limits for the vertical axis.

specnames

Vector positions of species names to add to the rank-abundance curve.

srt

The string rotation in degrees of the species names (as in par).

return.data

Return the data used for plotting.

rainbow

Use rainbow colouring for the different curves.

legend

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

...

Other arguments to be passed to functions plot or points.

Details

These functions provide methods of calculating and plotting rank-abundance curves.

The vertical axis can be scaled by various methods. Method "abundance" uses abundance, "proportion" uses proportional abundance (species abundance / total abundance), "logabun" calculates the logarithm of abundance using base 10 and "accumfreq" accumulates the proportional abundance.

The horizontal axis can be scaled by the total number of species, or by 100 percent of all species by option "scaledx".

The method of calculating the confidence interval for species proportion is described in Hayek and Buzas (1997).

Functions rankabundance and rankabuncomp allow to calculate rank abundance curves for subsets of the community and environmental data sets. Function rankabundance calculates the rank abundance curve for the specified level of a selected environmental variable. Method rankabuncomp calculates the rank abundance curve for all levels of a selected environmental variable separatedly.

Value

The functions provide information on rankabundance curves. Function rankabundance provides information on abundance, proportional abundance, logarithmic abundance and accumulated proportional abundance. The function also provides confidence interval limits for the proportion of each species (plower, pupper) and the proportion of species ranks (in percentage).

Author(s)

Roeland Kindt (World Agroforestry Centre)

References

Hayek, L.-A. C. & Buzas, M.A. (1997). Surveying Natural Populations. Columbia University Press.

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

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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
library(vegan)
data(dune.env)
data(dune)
RankAbun.1 <- rankabundance(dune)
RankAbun.1
rankabunplot(RankAbun.1, scale='abundance', addit=FALSE, specnames=c(1,2,3))
rankabunplot(RankAbun.1, scale='logabun', addit=FALSE, specnames=c(1:30), 
    srt=45, ylim=c(1,100))
rankabuncomp(dune, y=dune.env, factor='Management', 
    scale='proportion', legend=FALSE)
## CLICK IN THE GRAPH TO INDICATE WHERE THE LEGEND NEEDS TO BE PLACED
## IF YOU OPT FOR LEGEND=TRUE.

## Not run: 
# ggplot2 plotting method

# Only label the two most abundant species
RA.data <- rankabuncomp(dune, y=dune.env, factor='Management', 
    return.data=TRUE, specnames=c(1:2), legend=FALSE)

library(ggplot2)
library(ggrepel)

# 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())

plotgg1 <- ggplot(data=RA.data, aes(x = rank, y = abundance)) + 
    scale_x_continuous(expand=c(0, 1), sec.axis = dup_axis(labels=NULL, name=NULL)) +
    scale_y_continuous(expand=c(0, 1), sec.axis = dup_axis(labels=NULL, name=NULL)) +
    geom_line(aes(colour=Grouping), size=1) +
    geom_point(aes(colour=Grouping, shape=Grouping), size=5, alpha=0.7) +
    geom_text_repel(data=subset(RA.data, labelit == TRUE), 
        aes(colour=Grouping, label=species), 
        angle=45, nudge_x=1, nudge_y=1, show.legend=FALSE) +
    BioR.theme +
    scale_color_brewer(palette = "Set1") +
    labs(x = "rank", y = "abundance", colour = "Management", shape = "Management")

plotgg1

# use different facets
# now label first 10 species
RA.data <- rankabuncomp(dune, y=dune.env, factor='Management', 
    return.data=TRUE, specnames=c(1:10), legend=FALSE)

plotgg2 <- ggplot(data=RA.data, aes(x = rank, y = abundance)) + 
    scale_x_continuous(expand=c(0, 1), sec.axis = dup_axis(labels=NULL, name=NULL)) +
    scale_y_continuous(expand=c(0, 1), sec.axis = dup_axis(labels=NULL, name=NULL)) +
    geom_line(aes(colour=Grouping), size=1) +
    geom_point(aes(colour=Grouping), size=5, alpha=0.7) +
    geom_text_repel(data=subset(RA.data, labelit == TRUE), 
        aes(label=species), 
        angle=45, nudge_x=1, nudge_y=1, show.legend=FALSE) +
    BioR.theme +
    scale_color_brewer(palette = "Set1") +
    facet_wrap(~ Grouping) +
    labs(x = "rank", y = "abundance", colour = "Management")

plotgg2



## End(Not run) # dontrun

Example output

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
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'. 
         rank abundance proportion plower pupper accumfreq logabun rankfreq
Poatriv     1        63        9.2    6.0   12.4       9.2     1.8      3.3
Lolipere    2        58        8.5    4.9   12.0      17.7     1.8      6.7
Scorautu    3        54        7.9    5.7   10.0      25.5     1.7     10.0
Bracruta    4        49        7.2    4.6    9.7      32.7     1.7     13.3
Agrostol    5        48        7.0    3.3   10.7      39.7     1.7     16.7
Poaprat     6        48        7.0    4.8    9.2      46.7     1.7     20.0
Trifrepe    7        47        6.9    4.5    9.2      53.6     1.7     23.3
Alopgeni    8        36        5.3    1.8    8.7      58.8     1.6     26.7
Elymrepe    9        26        3.8    1.1    6.5      62.6     1.4     30.0
Planlanc   10        26        3.8    1.2    6.4      66.4     1.4     33.3
Eleopalu   11        25        3.6    0.3    7.0      70.1     1.4     36.7
Anthodor   12        21        3.1    0.8    5.4      73.1     1.3     40.0
Sagiproc   13        20        2.9    0.9    5.0      76.1     1.3     43.3
Juncarti   14        18        2.6    0.4    4.9      78.7     1.3     46.7
Rumeacet   15        18        2.6    0.3    4.9      81.3     1.3     50.0
Achimill   16        16        2.3    0.7    4.0      83.6     1.2     53.3
Bromhord   17        15        2.2    0.4    4.0      85.8     1.2     56.7
Ranuflam   18        14        2.0    0.4    3.7      87.9     1.1     60.0
Bellpere   19        13        1.9    0.6    3.2      89.8     1.1     63.3
Juncbufo   20        13        1.9    0.0    3.8      91.7     1.1     66.7
Salirepe   21        11        1.6   -0.3    3.6      93.3     1.0     70.0
Callcusp   22        10        1.5   -0.3    3.2      94.7     1.0     73.3
Hyporadi   23         9        1.3   -0.4    3.1      96.1     1.0     76.7
Trifprat   24         9        1.3   -0.3    2.9      97.4     1.0     80.0
Airaprae   25         5        0.7   -0.4    1.8      98.1     0.7     83.3
Comapalu   26         4        0.6   -0.3    1.5      98.7     0.6     86.7
Vicilath   27         4        0.6   -0.1    1.3      99.3     0.6     90.0
Empenigr   28         2        0.3   -0.3    0.9      99.6     0.3     93.3
Cirsarve   29         2        0.3   -0.3    0.9      99.9     0.3     96.7
Chenalbu   30         1        0.1   -0.2    0.5     100.0     0.0    100.0
   Grouping  species labelit rank abundance proportion plower pupper accumfreq
1        BF Lolipere    TRUE    1        18       15.4    3.6   27.2      15.4
2        BF Trifrepe    TRUE    2        14       12.0    6.6   17.3      27.4
3        BF Scorautu    TRUE    3        13       11.1    0.7   21.5      38.5
4        BF  Poaprat   FALSE    4        12       10.3    6.3   14.2      48.7
5        BF  Poatriv   FALSE    5        11        9.4   -9.9   28.7      58.1
6        BF Bromhord   FALSE    6         8        6.8   -5.2   18.9      65.0
7        BF Achimill   FALSE    7         7        6.0   -5.0   17.0      70.9
8        BF Planlanc   FALSE    8         6        5.1   -6.9   17.1      76.1
9        BF Bracruta   FALSE    9         6        5.1   -9.3   19.5      81.2
10       BF Bellpere   FALSE   10         5        4.3   -4.0   12.5      85.5
11       BF Anthodor   FALSE   11         4        3.4  -10.6   17.4      88.9
12       BF Elymrepe   FALSE   12         4        3.4  -10.8   17.6      92.3
13       BF Vicilath   FALSE   13         3        2.6   -4.6    9.8      94.9
14       BF Alopgeni   FALSE   14         2        1.7   -5.4    8.8      96.6
15       BF Hyporadi   FALSE   15         2        1.7   -6.3    9.7      98.3
16       BF Sagiproc   FALSE   16         2        1.7   -6.3    9.7     100.0
17       HF  Poatriv    TRUE    1        24       11.3    8.4   14.1      11.3
18       HF Lolipere    TRUE    2        20        9.4    3.7   15.1      20.7
19       HF  Poaprat    TRUE    3        17        8.0    4.9   11.1      28.6
20       HF Rumeacet   FALSE    4        16        7.5    1.1   13.9      36.2
21       HF Planlanc   FALSE    5        15        7.0   -0.7   14.7      43.2
22       HF Scorautu   FALSE    6        14        6.6    5.2    8.0      49.8
23       HF Trifrepe   FALSE    7        14        6.6    3.3    9.8      56.3
24       HF Bracruta   FALSE    8        14        6.6    1.9   11.2      62.9
25       HF Elymrepe   FALSE    9        10        4.7   -3.6   13.0      67.6
26       HF Anthodor   FALSE   10         9        4.2   -0.8    9.2      71.8
27       HF Trifprat   FALSE   11         9        4.2   -1.4    9.9      76.1
28       HF Alopgeni   FALSE   12         8        3.8   -3.1   10.6      79.8
29       HF Juncarti   FALSE   13         8        3.8   -2.8   10.3      83.6
30       HF Agrostol   FALSE   14         7        3.3   -2.6    9.1      86.9
31       HF Achimill   FALSE   15         6        2.8   -0.3    5.9      89.7
32       HF Juncbufo   FALSE   16         6        2.8   -2.5    8.1      92.5
33       HF Eleopalu   FALSE   17         4        1.9   -3.4    7.2      94.4
34       HF Sagiproc   FALSE   18         4        1.9   -1.4    5.2      96.2
35       HF Bromhord   FALSE   19         4        1.9   -1.4    5.1      98.1
36       HF Bellpere   FALSE   20         2        0.9   -1.7    3.5      99.1
37       HF Ranuflam   FALSE   21         2        0.9   -1.7    3.6     100.0
38       NM Scorautu    TRUE    1        19       12.6    6.0   19.2      12.6
39       NM Bracruta    TRUE    2        17       11.3    2.6   19.9      23.8
40       NM Agrostol    TRUE    3        13        8.6   -1.2   18.4      32.5
41       NM Eleopalu   FALSE    4        13        8.6   -1.4   18.6      41.1
42       NM Salirepe   FALSE    5        11        7.3   -0.2   14.8      48.3
43       NM Trifrepe   FALSE    6        11        7.3   -2.0   16.6      55.6
44       NM Anthodor   FALSE    7         8        5.3   -3.8   14.4      60.9
45       NM Ranuflam   FALSE    8         8        5.3   -1.2   11.8      66.2
46       NM Hyporadi   FALSE    9         7        4.6   -3.8   13.1      70.9
47       NM Juncarti   FALSE   10         7        4.6   -2.7   12.0      75.5
48       NM Callcusp   FALSE   11         7        4.6   -2.8   12.1      80.1
49       NM Airaprae   FALSE   12         5        3.3   -2.4    9.0      83.4
50       NM Planlanc   FALSE   13         5        3.3   -2.6    9.2      86.8
51       NM  Poaprat   FALSE   14         4        2.6   -2.5    7.8      89.4
52       NM Comapalu   FALSE   15         4        2.6   -1.8    7.1      92.1
53       NM Sagiproc   FALSE   16         3        2.0   -2.9    6.9      94.0
54       NM Achimill   FALSE   17         2        1.3   -2.4    5.0      95.4
55       NM Bellpere   FALSE   18         2        1.3   -2.0    4.7      96.7
56       NM Empenigr   FALSE   19         2        1.3   -1.9    4.6      98.0
57       NM Lolipere   FALSE   20         2        1.3   -2.0    4.7      99.3
58       NM Vicilath   FALSE   21         1        0.7   -1.0    2.3     100.0
59       SF Agrostol    TRUE    1        28       13.7    7.8   19.7      13.7
60       SF  Poatriv    TRUE    2        28       13.7    6.3   21.1      27.5
61       SF Alopgeni    TRUE    3        26       12.7    4.5   21.0      40.2
62       SF Lolipere   FALSE    4        18        8.8   -2.1   19.8      49.0
63       SF  Poaprat   FALSE    5        15        7.4    0.5   14.2      56.4
64       SF Elymrepe   FALSE    6        12        5.9   -1.0   12.8      62.3
65       SF Bracruta   FALSE    7        12        5.9    0.8   10.9      68.1
66       SF Sagiproc   FALSE    8        11        5.4   -0.8   11.5      73.5
67       SF Eleopalu   FALSE    9         8        3.9   -6.3   14.1      77.5
68       SF Scorautu   FALSE   10         8        3.9    1.4    6.4      81.4
69       SF Trifrepe   FALSE   11         8        3.9    0.5    7.3      85.3
70       SF Juncbufo   FALSE   12         7        3.4   -2.3    9.2      88.7
71       SF Bellpere   FALSE   13         4        2.0   -0.9    4.8      90.7
72       SF Ranuflam   FALSE   14         4        2.0   -1.3    5.2      92.6
73       SF Juncarti   FALSE   15         3        1.5   -2.4    5.3      94.1
74       SF Callcusp   FALSE   16         3        1.5   -2.4    5.3      95.6
75       SF Bromhord   FALSE   17         3        1.5   -2.1    5.0      97.1
76       SF Rumeacet   FALSE   18         2        1.0   -1.5    3.5      98.0
77       SF Cirsarve   FALSE   19         2        1.0   -1.4    3.3      99.0
78       SF Achimill   FALSE   20         1        0.5   -0.9    1.9      99.5
79       SF Chenalbu   FALSE   21         1        0.5   -0.8    1.8     100.0
   logabun rankfreq
1      1.3      6.2
2      1.1     12.5
3      1.1     18.8
4      1.1     25.0
5      1.0     31.2
6      0.9     37.5
7      0.8     43.8
8      0.8     50.0
9      0.8     56.2
10     0.7     62.5
11     0.6     68.8
12     0.6     75.0
13     0.5     81.2
14     0.3     87.5
15     0.3     93.8
16     0.3    100.0
17     1.4      4.8
18     1.3      9.5
19     1.2     14.3
20     1.2     19.0
21     1.2     23.8
22     1.1     28.6
23     1.1     33.3
24     1.1     38.1
25     1.0     42.9
26     1.0     47.6
27     1.0     52.4
28     0.9     57.1
29     0.9     61.9
30     0.8     66.7
31     0.8     71.4
32     0.8     76.2
33     0.6     81.0
34     0.6     85.7
35     0.6     90.5
36     0.3     95.2
37     0.3    100.0
38     1.3      4.8
39     1.2      9.5
40     1.1     14.3
41     1.1     19.0
42     1.0     23.8
43     1.0     28.6
44     0.9     33.3
45     0.9     38.1
46     0.8     42.9
47     0.8     47.6
48     0.8     52.4
49     0.7     57.1
50     0.7     61.9
51     0.6     66.7
52     0.6     71.4
53     0.5     76.2
54     0.3     81.0
55     0.3     85.7
56     0.3     90.5
57     0.3     95.2
58     0.0    100.0
59     1.4      4.8
60     1.4      9.5
61     1.4     14.3
62     1.3     19.0
63     1.2     23.8
64     1.1     28.6
65     1.1     33.3
66     1.0     38.1
67     0.9     42.9
68     0.9     47.6
69     0.9     52.4
70     0.8     57.1
71     0.6     61.9
72     0.6     66.7
73     0.5     71.4
74     0.5     76.2
75     0.5     81.0
76     0.3     85.7
77     0.3     90.5
78     0.0     95.2
79     0.0    100.0

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