Description Usage Arguments Value Author(s) See Also Examples
View source: R/Plotfunctions.R
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.
1 | 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>
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.