Learn R Programming

DiversityOccupancy (version 1.0.5)

diversity.predict: Makes a spacially explicit prediction of the occupancy of multiple species and alpha diversity, and select the area where

Description

This function takes an deiversityoccu object and predicts occupancy for all species in new data, either a data.frame or a rasterstack. It can also return a subset of the total area of a rasterstack, where diversity and occupancy/abundance are higher than the nth quantile.

Usage

diversity.predict(model, diverse, new.data, quantile.nth = 0.8, species, kml = TRUE, name = "Priority_Area.kml")

Arguments

model
A result from diversityoccu
diverse
A result from the model.diversity function.
new.data
a rasterstack, or a dataframe containing the same variables as the siteCovs variable in diversityoccu or batchoccu
quantile.nth
the nth quantile, over which is a goal to keep both diversity and selected species. default = NULL
species
a boolean vector of the species to take into acount
kml
if TRUE builds a kml file of the selected area and saves it in your working directry
name
the name of the kml file if kml is TRUE

Value

a data frame with predicted values, or a raster stack with predictions for each species, a raster for diversity and a raster with the area meeting the quantile criteria.

See Also

diversityoccu

batchoccu

model.diversity

Examples

Run this code
## Not run: 
# #Load the data
# data("IslandBirds")
# data("Daily_Cov")
# data("siteCov")
# data("Birdstack")
# 
# #Model the abundance for  5 bat species and calculate alpha diversity from that
# 
# #Model the abundance for  5 bat species and calculate alpha diversity from that
# 
# BirdDiversity <-diversityoccu(pres = IslandBirds, sitecov = siteCov,
# obscov = Daily_Cov,spp =  5, form = ~ Day + Wind + Time ~ Elev + Wetland + Upland)
# 
# #Select the best model that explains diversity using genetic algorithms
# set.seed(123)
# glm.Birdiversity <- model.diversity(BirdDiversity, method = "g")
# 
# # get the area where the first two bird species are most abundant
# # and the diversity is high
# 
# library(rgdal)
# Selected.area <- diversity.predict(model = BirdDiversity, diverse = glm.Birdiversity,
# new.data = Birdstack, quantile.nth = 0.65, species =
# c(TRUE, TRUE, FALSE, FALSE, FALSE))
# 
# Selected.area
# ## End(Not run)

Run the code above in your browser using DataLab