renyiresult: Alternative Renyi Diversity Results

renyiresultR Documentation

Alternative Renyi Diversity Results

Description

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

Usage

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

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

BiodiversityR documentation built on June 22, 2024, 11:57 a.m.