scrData: makes an object of class "scrdata" which can be analyzed by...

Description Usage Arguments Details Value Author(s) References Examples

View source: R/scrData.R

Description

packages up capture data, trap information and state-space information to make a data object of class "scrobj".

Right now it doesn't do anything special except package the input as a list and slightly reformat some things. In the future it will check for consistency of the different data files, run some error checks, and produce some additional output.

Usage

1
scrData(traps, captures, statespace, alive = NULL, Xd = NULL)

Arguments

traps

ntraps x (3+noccasions) matrix: column 1 = trap ID, column 2 = x coordinate of trap, column 3 = y coordinate of trap, columns 4:(3+noccasions) = trap operation mask, 1 if operated, 0 if not

captures

Matrix having encounter information about each individual. Some flexibility is allowed in data format (more flexibility in the future). Minimally, the matrix should have columns labeled "individual" "occasion" and "trapid".

"individual" = integer from 1:nind

"occasion" = integer from 1:(noccasions)

"trapid" = integer from 1:ntraps mapping to rows of "traps"

Optionally may have a column "session" which is the year or primary period of the sample. Currently no multi-session functionality is available but the main functions of SCRbayes accepts this data structure.

statespace

This is an "ngrid x 3" matrix describing the state-space of the point process model describing the distribution of individuals. The column fields are: column 1 = x-coordinate of potential activity center, column 2 = y-coordinate of potential activity center, column 3 = binary indicator of suitable habitat (1) or not (0)

alive

A matrix describing whether each individual was available for sampling (1) or not (0). Models in SCRbayes assume you know whether individual were removed or not, without error. The matrix should be "nind x noccasions".

Xeff

Xeff=j by k matrix where k=the number of surveys and j=the number of traps. For each row indicate the amount of survey effort conducted in that trap location during survey k, if effort was equal across all surveyed areas Xeff=NULL; If a trap x occasion was not sampled then any value can be used for effort because those elements of Xeff will not be extracted for the likelihood calculations. (the file "traps" contains information about which traps x occasions were sampled, see above).

Xsex

Xsex = a vector of length n where n= the number of animals; Xsex[i] is either a zero or 1 indicating the sex of animal [i] in the capture file, must be provided if Msex or Msexsigma=1

Xd

A "density covariate" – should be a vector of "ngrid x 1" where ngrid = nrow(statespace).

Ytel

Telemetry data on a sample of individuals. This must have 3 columns:

x-coord, y-coord, Individual

being the locations of each telemetry location and the individual ID. Make sure individual ID is an integer from 1 to however many individuals were telemetered.

If any models will be fitted that involve sex-specific sigma, then you need to provide an attribute labeled "sex" to Ytel and this should be a numeric vector of 0's and 1's. (same format as Xsex).

It is assumed that the telemetry sample and the SCR sample of individuals are independent and the model does not allow for them to be reconciled.

Xtel

habitat covariate for telemetry data. right now this has to be the same dimension as Xd , i.e., length = size of state-space.

Details

more to come ....

Value

an object of class "scrdata"

Author(s)

Andy Royle, aroyle@usgs.gov

References

For the use of telemetry data see the paper:

Royle, J.A., R.B. Chandler, C.C. Sun and A.K. Fuller. (2013). Integrating resource selection information with spatial capture-recapture. Methods in Ecology and Evolution, 3:545-554.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as

library(SCRbayes)
data(lions)

dimnames(captures.lions)<-
   list(1:nrow(captures.lions),c("trapid","individual","occasion"))

lion.scrdata <- scrData(traps.lions,captures.lions,statespace.lions)

test <- SCRh.fn(lion.scrdata,ni=220, burn=20,
 skip=2,nz=200,Msigma=1, Mb=0, Msex=0, Msexsigma=0, 
 thinstatespace=2)

jaroyle/SCRbayes documentation built on May 18, 2019, 4:48 p.m.