diversity.predict: Makes a spacially explicit prediction of the occupancy of...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/DiversityOccu.R

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

1
2
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.

Author(s)

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

See Also

diversityoccu

batchoccu

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
26
27
28
29
## 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)

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