responseplot.diver {DiversityOccupancy} | R Documentation |
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.
responseplot.diver(model, variable)
model |
A result from the model.diversity function. |
variable |
The variable of which the response is to be ploted. |
a ggplot object plotting the alpha diversity response to the selected variable.
Derek Corcoran <derek.corcoran.barrios@gmail.com>
## 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)