Learn R Programming

secr (version 2.5.0)

usage: Detector Usage

Description

Extract or replace usage information of a traps object.

Usage

usage(object, ...)
usage(object) <- value

Arguments

object
traps object
value
numeric matrix of detectors x occasions, or a vector (see Details).
...
other arguments (not used)

Value

  • usage(object) returns the usage matrix of the traps object. usage(object) may be NULL.

Details

In secr versions before 2.5.0, usage was defined as a binary value (1 if trap $k$ used on occasion $s$, zero otherwise). In later versions, usage may take nonnegative real values and will be interpreted as effort. This corresponds to the constant T_s used for the duration of sampling by Borchers and Efford (2008). Effort is modelled as a known linear coefficient of detection probability on the hazard scale (../doc/secr-varyingeffort.pdf). For replacement, various forms are possible for value: - a matrix in which the number of rows of value exactly matches the number of traps K in object - a vector of two values, the usage (typically 1) and the number of occasions S (a K x S matrix will be filled with the first value) - a vector of R+1 values where R is the number of sessions in a multi-session object and elements 2..R+1 correspond to the numbers of occasions S1, S2,... in each session - the usage only (typically 1) (only works when replacing an existing usage matrix with known number of occasions).

See Also

traps, usagePlot

Examples

Run this code
demo.traps <- make.grid(nx = 6, ny = 8)
## random usage over 5 occasions
usage(demo.traps) <- matrix (sample(0:1, 48*5, replace = TRUE, 
    p = c(0.5,0.5)), nc = 5)
usage(demo.traps)
summary(demo.traps)

usage(traps(ovenCH)) <- c(1,9,10,10,10,10)
## restore lost names
names(ovenCH) <- 2005:2009

Run the code above in your browser using DataLab