Learn R Programming

secr (version 1.3.0)

traps: Detector Array

Description

An object of class traps encapsulates a set of detector (trap) locations and related data. A method of the same name extracts or replaces the traps attribute of a capthist object.

Usage

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

Arguments

object
a capthist object.
value
traps object to replace previous.
...
other arguments (not used).

Details

An object of class traps holds detector (trap) locations as a data frame of x-y coordinates. Trap identifiers are used as row names. The required attribute 'detector' records the type of detector ('single', 'multi' or 'proximity'). Other possible attributes of a traps object are trap-specific covariates (covariates) and a matrix of binary (0/1) codes indicating whether each detector was used on each occasion (usage). If usage is specified, at least one detector must be 'used' on each occasion.

References

Efford, M. G. (2007) Density 4.1: software for spatially explicit capture--recapture. Department of Zoology, University of Otago, Dunedin, New Zealand. http://www.otago.ac.nz/density Efford, M. G., Borchers D. L. and Byrom, A. E. (2009) Density estimation by spatially explicit capture-recapture: likelihood-based methods. In: D. L. Thomson, E. G. Cooch and M. J. Conroy (eds) Modeling Demographic Processes in Marked Populations. Springer, New York. Pp. 255--269.

See Also

make.grid, read.traps, plot.traps, secr.fit

Examples

Run this code
demotraps <- make.grid(nx = 8, ny = 6, spacing = 30)
demotraps    ## uses print method for traps
summary (demotraps)

plot (demotraps, border = 50, label = TRUE, offset = 8, 
    gridlines=FALSE)  

## generate an arbitrary covariate 'randcov'
covariates (demotraps) <- data.frame(randcov = rnorm(48))

## overplot detectors that have high covariate values
temptr <- subset(demotraps, covariates(demotraps)$randcov > 0.5)
plot (temptr, add = TRUE, 
    detpar = list (pch = 16, col = 'green', cex = 2))

Run the code above in your browser using DataLab