renyiresult: Alternative Renyi Diversity Results

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

Description

Provides some alternative methods of obtaining results on Renyi diversity profile values than provided by renyi (vegan).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
renyiresult(x, y=NULL, factor, level, method = "all",
    scales = c(0, 0.25, 0.5, 1, 2, 4, 8, Inf), evenness = FALSE ,...)

renyiplot(xr, addit=FALSE, pch = 1, 
    xlab = "alpha", ylab = "H-alpha", ylim = NULL,
    labelit = TRUE, legend = TRUE, legend.x="topleft", legend.ncol = 8, 
    col = 1, cex = 1, rainbow = TRUE, evenness = FALSE, ...)

renyiaccumresult(x, y=NULL, factor, level,
    scales=c(0, 0.25, 0.5, 1, 2, 4, 8, Inf), permutations = 100,...)

renyicomp(x, y, factor, sites=Inf,
    scales = c(0, 0.25, 0.5, 1, 2, 4, 8, Inf), permutations = 100, plotit = FALSE, ...)

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 diversity profiles for.

level

Level of the variable to create the subset to calculate diversity profiles.

method

Method of calculating the diversity profiles: "all" calculates the diversity of the entire community (all sites pooled together), "s" calculates the diversity of each site separatedly.

scales

Scale parameter values as in function renyi (vegan).

evenness

Calculate or plot the evenness profile.

xr

Result from renyi or renyiresult.

addit

Add diversity profile to an existing graph.

pch

Symbol used for drawing the diversity profiles (as in function points).

xlab

Label for the horizontal axis.

ylab

Label for the vertical axis.

ylim

Limits of the vertical axis.

labelit

Provide site labels (site names) at beginning and end of the diversity profiles.

legend

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

legend.x

Location of the legend; see also legend.

legend.ncol

number of columns for the legend (as in function legend).

col

Colour for the diversity profile (as in function points).

cex

Character expansion factor (as in function points).

rainbow

Use rainbow colours for the diversity profiles.

sites

Number of accumulated sites to provide profile values.

permutations

Number of permutations for the Monte-Carlo simulations for accumulated renyi diversity profiles (estimated by renyiaccum).

plotit

Plot the results (you need to click in the graph where the legend should be plotted).

...

Other arguments to be passed to functions renyi or plot.

Details

These functions provide some alternative methods of obtaining results with diversity profiles, although function renyi is always used to calculate the diversity profiles.

The method of calculating the diversity profiles: "all" calculates the diversity profile of the entire community (all sites pooled together), whereas "s" calculates the diversity profile of each site separatedly. The evenness profile is calculated by subtracting the profile value at scale 0 from all the profile values.

Functions renyiresult, renyiaccumresult and renyicomp allow to calculate diversity profiles for subsets of the community and environmental data sets. functions renyiresult and renyiaccumresult calculate the diversity profiles for the specified level of a selected environmental variable. Method renyicomp calculates the diversity profile for all levels of a selected environmental variable separatedly.

Functions renyicomp and renyiaccumresult calculate accumulation curves for the Renyi diversity profile by randomised pooling of sites and calculating diversity profiles for the pooled sites as implemented in renyiaccum. The method is similar to the random method of species accumulation (specaccum). If the number of "sites" is not changed from the default, it is replaced by the sample size of the level with the fewest number of sites.

Value

The functions provide alternative methods of obtaining Renyi diversity profiles.

Author(s)

Roeland Kindt (World Agroforestry Centre)

References

Kindt R., Degrande A., Turyomurugyendo L., Mbosso C., Van Damme P., Simons A.J. (2001). Comparing species richness and evenness contributions to on-farm tree diversity for data sets with varying sample sizes from Kenya, Uganda, Cameroon and Nigeria with randomised diversity profiles. Paper presented at IUFRO conference on forest biometry, modeling and information science, 26-29 June, University of Greenwich, UK

Kindt R. (2002). Methodology for tree species diversification planning for African agroecosystems. Thesis submitted in fulfilment of the requirement of the degree of doctor (PhD) in applied biological sciences. Faculty of agricultural and applied biological sciences, Ghent University, Ghent (Belgium), 332+xi pp.

Kindt R., Van Damme P. & Simons A.J. (2006). Tree diversity in western Kenya: using diversity profiles to characterise richness and evenness. Biodiversity and Conservation 15: 1253-1270.

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

renyi.long, renyicomp.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
library(vegan)
data(dune.env)
data(dune)
Renyi.1 <- renyiresult(dune, y=dune.env, factor='Management', level='NM', 
    method='s')
Renyi.1
renyiplot(Renyi.1, evenness=FALSE, addit=FALSE, pch=1,col='1', cex=1, 
    legend=FALSE)
## CLICK IN THE GRAPH TO INDICATE WHERE THE LEGEND NEEDS TO BE PLACED
## IN CASE THAT YOU OPT FOR LEGEND=TRUE

## Not run: 
# ggplot2 plotting method

Renyi.2 <- renyicomp(dune, y=dune.env, factor='Management', 
  scales=c(0, 0.25, 0.5, 1, 2, 4, 8, Inf), permutations=100, plotit=F)
Renyi.2

library(ggplot2)

# change the theme
# 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())

renyi.long2 <- renyicomp.long(Renyi.2, label.freq=1)

plotgg1 <- ggplot(data=renyi.long2, aes(x=Scales, y=Diversity, ymax=UPR, ymin=LWR)) + 
    scale_x_discrete() +
    scale_y_continuous(sec.axis = dup_axis(labels=NULL, name=NULL)) +
    geom_line(data=renyi.long2, aes(x=Obs, colour=Grouping), size=2) +
    geom_point(data=subset(renyi.long2, labelit==TRUE), 
        aes(colour=Grouping, shape=Grouping), size=5) +
    geom_ribbon(data=renyi.long2, aes(x=Obs, colour=Grouping), alpha=0.2, show.legend=FALSE) + 
    BioR.theme +
    scale_color_brewer(palette = "Set1") +
    labs(x=expression(alpha), y = "Diversity", colour = "Management", shape = "Management")

plotgg1

# calculate a separate diversity profile for each site
Renyi.3 <- renyiresult(dune, evenness=FALSE, method="s", 
  scales=c(0, 0.25, 0.5, 1, 2, 4, 8, Inf))
Renyi.3

renyi.long3 <- renyi.long(Renyi.3, env.data=dune.env, label.freq=2)

plotgg2 <- ggplot(data=renyi.long3, aes(x=Scales, y=Diversity, group=Grouping)) + 
    scale_x_discrete() +
    scale_y_continuous(sec.axis = dup_axis(name=NULL)) +
    geom_line(aes(colour=Management), size=2) +
    geom_point(data=subset(renyi.long3, labelit==TRUE), 
        aes(colour=Management, shape=Management), size=5) +
    BioR.theme +
    scale_color_brewer(palette = "Set1") +
    labs(x=expression(alpha), y="Diversity", colour="Management")

plotgg2

plotgg3 <- ggplot(data=renyi.long3, aes(x=Scales, y=Diversity, group=Grouping)) + 
    scale_x_discrete() +
    scale_y_continuous(sec.axis = dup_axis(name=NULL)) +
    geom_line(aes(colour=Management), size=1) +
    geom_point(data=subset(renyi.long3, labelit==TRUE), 
        aes(colour=Management, shape=Management), size=2) +
    BioR.theme +
    scale_color_brewer(palette = "Set1") +
    facet_wrap(~ Management) +
    labs(x=expression(alpha), y="Diversity", colour="Management")

plotgg3


## 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'. 
          0     0.25      0.5        1        2        4        8      Inf
14 1.945910 1.924760 1.903910 1.863680 1.791759 1.685608 1.568464 1.386294
15 2.079442 2.052329 2.026569 1.979309 1.901541 1.799190 1.700737 1.526056
17 1.945910 1.928634 1.911283 1.876274 1.805182 1.670706 1.507813 1.321756
18 2.197225 2.166665 2.136775 2.079387 1.976553 1.827081 1.687670 1.504077
19 2.197225 2.181523 2.165714 2.134024 2.072184 1.966263 1.840730 1.642228
20 2.079442 2.070929 2.062912 2.048270 2.023787 1.988294 1.943914 1.824549
Set of permutations < 'minperm'. Generating entire set.
Set of permutations < 'minperm'. Generating entire set.
Set of permutations < 'minperm'. Generating entire set.
, ,  = mean

          scale
Management        0     0.25      0.5        1        2        4        8
        BF 2.772589 2.716195 2.662749 2.566756 2.420204 2.252630 2.105191
        HF 2.944615 2.902839 2.863639 2.793440 2.683367 2.543503 2.400280
        NM 2.800653 2.755214 2.710973 2.627431 2.486382 2.310273 2.168403
        SF 2.789960 2.722267 2.658076 2.542802 2.368108 2.177795 2.032351
          scale
Management      Inf
        BF 1.871802
        HF 2.162933
        NM 1.966790
        SF 1.834025

, ,  = stdev

          scale
Management          0       0.25        0.5          1          2          4
        BF         NA         NA         NA         NA         NA         NA
        HF 0.09218297 0.09157221 0.09035020 0.08661188 0.07742437 0.06523049
        NM 0.10319549 0.10015845 0.09660778 0.08818420 0.07494106 0.08805322
        SF 0.07824185 0.08006319 0.08171454 0.08374267 0.08585575 0.09588423
          scale
Management          8        Inf
        BF         NA         NA
        HF 0.06575259 0.07553559
        NM 0.11338216 0.11503553
        SF 0.10645207 0.11448113

, ,  = min

          scale
Management        0     0.25      0.5        1        2        4        8
        BF       NA       NA       NA       NA       NA       NA       NA
        HF 2.708050 2.667574 2.631770 2.572529 2.489872 2.395696 2.307250
        NM 2.302585 2.286839 2.270992 2.239186 2.176726 2.068560 1.944138
        SF 2.639057 2.568654 2.504130 2.378479 2.189765 2.005640 1.851827
          scale
Management      Inf
        BF       NA
        HF 2.055725
        NM 1.725510
        SF 1.677646

, ,  = max

          scale
Management        0     0.25      0.5        1        2        4        8
        BF       NA       NA       NA       NA       NA       NA       NA
        HF 3.044522 3.002965 2.963682 2.892405 2.776243 2.632510 2.523664
        NM 2.944439 2.892382 2.839436 2.736108 2.598566 2.439474 2.355136
        SF 2.944439 2.881677 2.817994 2.692785 2.495236 2.337517 2.247298
          scale
Management      Inf
        BF       NA
        HF 2.302585
        NM 2.151762
        SF 2.100061

, ,  = Qnt 0.025

          scale
Management        0     0.25      0.5        1        2        4        8
        BF       NA       NA       NA       NA       NA       NA       NA
        HF 2.708050 2.667574 2.631770 2.572529 2.489872 2.395696 2.307250
        NM 2.708050 2.646588 2.588612 2.485541 2.332129 2.150454 1.960543
        SF 2.671829 2.595933 2.525721 2.378479 2.189765 2.005640 1.851827
          scale
Management      Inf
        BF       NA
        HF 2.055725
        NM 1.725510
        SF 1.677646

, ,  = Qnt 0.975

          scale
Management        0     0.25      0.5        1        2        4        8
        BF       NA       NA       NA       NA       NA       NA       NA
        HF 3.044522 3.002965 2.963682 2.892405 2.776243 2.632510 2.523664
        NM 2.944439 2.889745 2.833494 2.736108 2.598566 2.439474 2.355136
        SF 2.944439 2.876483 2.807592 2.670382 2.495236 2.337517 2.247298
          scale
Management      Inf
        BF       NA
        HF 2.302585
        NM 2.151762
        SF 2.100061

Warning message:
In max(ids, na.rm = TRUE) : no non-missing arguments to max; returning -Inf
          0     0.25      0.5        1        2        4        8       Inf
1  1.609438 1.561537 1.517359 1.440482 1.326396 1.192910 1.076167 0.9444616
2  2.302585 2.289569 2.276888 2.252516 2.207481 2.130014 2.017029 1.7917595
3  2.302585 2.273535 2.245545 2.193749 2.109901 2.008060 1.918415 1.7429693
4  2.564949 2.528843 2.493653 2.426779 2.310020 2.141677 1.963220 1.7272209
5  2.639057 2.615850 2.592188 2.544421 2.453496 2.317724 2.188338 1.9694406
6  2.397895 2.383942 2.370623 2.345946 2.304323 2.246666 2.187736 2.0794415
7  2.564949 2.542221 2.518968 2.471733 2.380547 2.241377 2.108978 1.8971200
8  2.484907 2.471612 2.458818 2.434898 2.394152 2.337416 2.275635 2.0794415
9  2.564949 2.547116 2.529208 2.493568 2.425483 2.313440 2.179750 1.9459101
10 2.484907 2.460586 2.438219 2.398613 2.335014 2.244713 2.137944 1.9694406
11 2.197225 2.174540 2.151691 2.106065 2.018817 1.877989 1.724252 1.5198258
12 2.197225 2.176894 2.156317 2.114495 2.029292 1.870297 1.683928 1.4759065
13 2.302585 2.252876 2.202043 2.099638 1.911611 1.667405 1.482300 1.2992830
14 1.945910 1.924760 1.903910 1.863680 1.791759 1.685608 1.568464 1.3862944
15 2.079442 2.052329 2.026569 1.979309 1.901541 1.799190 1.700737 1.5260563
16 2.079442 2.049434 2.019294 1.959795 1.851352 1.701259 1.576396 1.4170660
17 1.945910 1.928634 1.911283 1.876274 1.805182 1.670706 1.507813 1.3217558
18 2.197225 2.166665 2.136775 2.079387 1.976553 1.827081 1.687670 1.5040774
19 2.197225 2.181523 2.165714 2.134024 2.072184 1.966263 1.840730 1.6422277
20 2.079442 2.070929 2.062912 2.048270 2.023787 1.988294 1.943914 1.8245493
There were 20 warnings (use warnings() to see them)

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