responseplot.diver: plot the response of the calculated alpha diversity to the...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/Plotfunctions.R

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

1
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

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

DiversityOccupancy documentation built on May 2, 2019, 12:35 p.m.