abapToUnmarked_multi: ABAP to unmarked (multi-season)

View source: R/abapToUnmarked_multi.R

abapToUnmarked_multiR Documentation

ABAP to unmarked (multi-season)

Description

This function transforms a raw ABAP data frame (returned by getAbapData) into an unmarkedMultFrame object which can be used to fit dynamic occupancy models using colext (MacKenzie et. al 2003) and stan_colext from the ubms package (which fits Unmarked Bayesian Models with Stan).

Usage

abapToUnmarked_multi(abap_data, pentads = NULL)

Arguments

abap_data

multi-season ABAP data downloaded using getAbapData.

pentads

an sf object returned by getRegionPentads. Defaults to NULL.

Details

In addition to reformatting the detection/non-detection ABAP data for use in unmarked and ubms occupancy models, this function also extracts two survey-level covariates: hours and jday. The hours variable is the total number of hours spent atlassing which is recorded on the pentad card and jday is the Julian day corresponding to the first day of atlassing for that card.

The function also adds the sampling year as a yearlySiteCovs which allows year to be used in the formula for colonization, extinction and detection probability.

If pentads are provided the unmarked frame will add the X and Y coordinates as site-level covariates (siteCovs).

Value

an object of class unmarkedMultFrame

Note

The processing time of abapToUnmarked_multi can be considerably long if the number of cards and pentads of the focal species is high, so patience may be required.

Author(s)

Dominic Henry dominic.henry@gmail.com
Pachi Cervantes

References

MacKenzie, D. I., J. D. Nichols, J. E. Hines, M. G. Knutson, and A. B. Franklin. 2003. Estimating site occupancy, colonization, and local extinction when a species is detected imperfectly. Ecology 84:2200-2207.

See Also

colext, stan_colext

Examples

## Not run: 
library(unmarked)
abap_multi <- getAbapData(.spp = 212,
                          .region_type = "province",
                          .region = "Eastern Cape",
                          .years = c(2009,2010,2011,2012))

abap_pentads <- getRegionPentads(.region_type = "province",
                                  .region = "Eastern Cape")

## Return unmarked frame no site covariates
um_df <- abapToUnmarked_multi(abap_multi)
summary(um_df)

## Return unmarked frame with Pentad coordinates as site covariates
um_df <- abapToUnmarked_multi(abap_data = abap_multi, pentads = abap_pentads)
summary(um_df)

## End(Not run)

AfricaBirdData/ABAP documentation built on Aug. 4, 2024, 4:41 p.m.