batchoccu: Fits occupancy models for multiple species detection history

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/DiversityOccu.R

Description

This function takes a data.frame with multiple detection history from various species in different sites, covariates of each site to calculate occupancy, variables specific to sampling days to calculate probability of detection. It features an automatic model selection when dredge = TRUE.

Usage

1
2
batchoccu(pres, sitecov, obscov, spp, form, SppNames = NULL,
  dredge = FALSE)

Arguments

pres

a data.frame where rows are the sites and columns are a series of presence-absence observation from multiple species, every species needs to have the same number of observations.

sitecov

a data.frame where every row is a site, and every column is a measurement of that site, such as elevation or slope, this covariates are usually more constant.

obscov

a list where every element is a data frame with the daily covariates for each site, that is a measurement for each day, such as average temperature of a day, this covariates are usually very .

spp

the number of species in the pres data.frame

form

a formula in the format ~ obscov ~ sitcov, the first arguments will be used to calculate probability of detection and the second part the occupancy.

SppNames

A character vector with the name of the Species to annotate results, if null (Default) the results will have generic names such as Species.1

dredge

default = FALSE, if TRUE, for each species, the best occupancy model will be determined by fitting all possible models and ranking by AICc.

Details

This function fits the single season occupancy model of MacKenzie et al (2002), for multiple species and it can automatically select the best model for each specie based on AICc.

Value

A list with the fitted models for each species and the calculated Alpha diversity for each site.

Author(s)

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

See Also

diversityoccu

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
data("IslandBirds")
data("Daily_Cov")
data("siteCov")
BirdOccupancy <-batchoccu(pres = IslandBirds, sitecov = siteCov, obscov =
Daily_Cov, spp =  5, form = ~ Day + Wind + Rain + Noise + Clouds ~
Elev + AgroFo + SecVec + Wetland)
#plot the response of occupancy to individual variables for species 4 and  5

responseplot.occu(batch = BirdOccupancy, spp = 4, variable = "Elev")

responseplot.occu(batch = BirdOccupancy, spp =  5, variable = "Elev")

#Dredge for all species
BirdOccupancy2 <- batchoccu(pres = IslandBirds, sitecov = siteCov, obscov =
Daily_Cov, spp = 5, form = ~ 1 ~
Elev + AgroFo, dredge = TRUE)

derek-corcoran-barrios/DiversityOccu documentation built on Nov. 12, 2019, 7:31 p.m.