responseplot.diver {DiversityOccupancy}R Documentation

plot the response of the calculated alpha diversity to the change of a particular variable

Description

This function takes a modeldiversity object and one of the variables used to predict the alpha diversity index, and makes a plot showing the response of the diversity index against the selected variable. This function automatically limits the values of that variable to the maximum and minimum values of the dataset.

Usage

responseplot.diver(model, variable)

Arguments

model

A result from the model.diversity function.

variable

The variable of which the response is to be ploted.

Value

a ggplot object plotting the alpha diversity response to the selected variable.

Author(s)

Derek Corcoran <derek.corcoran.barrios@gmail.com>

See Also

diversityoccu

model.diversity

Examples

## Not run: 
#Load the data
data("IslandBirds")
data("Daily_Cov")
data("siteCov")

#Model the abundance for 5 bird species and calculate alpha diversity from that

BirdDiversity <-diversityoccu(pres = IslandBirds, sitecov = siteCov,
obscov = Daily_Cov,spp = 5, form = ~ Day + Wind + Time + Rain +
Noise ~ Elev + AgroFo + SecVec + Wetland + Upland)

#Select the best model that explains diversity using genetic algorithms
set.seed(123)
glm.Birdiversity <- model.diversity(BirdDiversity, method = "g")

#see the best models

glm.Birdiversity$Best.model

#plot the response of diversity to individual variables

plot(glm.Birdiversity, elev)

## End(Not run)

[Package DiversityOccupancy version 1.0.6 Index]