abapToUnmarked_single: ABAP to unmarked (single-season)

View source: R/abapToUnmarked_single.R

abapToUnmarked_singleR Documentation

ABAP to unmarked (single-season)

Description

This function transforms a raw ABAP data frame (returned by getAbapData) into an unmarkedFrameOccu object which can be used to fit single-season occupancy models using occu (MacKenzie et. al 2002) or occuRN (Royle and Nichols, 2003) in unmarked.

unmarkedFrameOccu objects can also be used to fit stan_occu or stan_occuRN models from the ubms package (which fits Unmarked Bayesian Models with Stan).

Usage

abapToUnmarked_single(abap_data, pentads = NULL)

Arguments

abap_data

single-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. If pentads are provided the unmarked frame will add the x and y coordinates as site covariates (siteCovs). The spatial data can be used as random effects to run a restricted spatial regression (RSR) occupancy model in ubms. See RSR for more details.

Value

an object of class unmarkedFrameOccu

Note

It's important to make sure that the .region_type and .region are the same when extracting abap_data and pentads (see example below). The processing time of abapToUnmarked_single 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, G. B. Lachman, S. Droege, J. Andrew Royle, and C. A. Langtimm. 2002. Estimating Site Occupancy Rates When Detection Probabilities Are Less Than One. Ecology 83: 2248-2255.

Royle, J. A. and Nichols, J. D. (2003) Estimating Abundance from Repeated Presence-Absence Data or Point Counts. Ecology, 84(3) pp. 777-790.

See Also

occu, occuRN, stan_occu, stan_occuRN

Examples

## Not run: 
abap_single <- getAbapData(.spp_code = 212,
                           .region_type = "province",
                           .region = "Eastern Cape",
                           .years = 2012)

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

## Return unmarked frame no site covariates
um_df <- abapToUnmarked_single(abap_single)

## Return unmarked frame with Pentad coordinates as site covariates
um_df <- abapToUnmarked_single(abap_single, abap_pentads)

## End(Not run)

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