Learn R Programming

secrlinear (version 1.0.3)

secrlinear-package: Spatially Explicit Capture--Recapture for Linear Habitats

Description

An secr add-on package for linear habitat models.

Arguments

Details

ll{ Package: secr Type: Package Version: 1.0.3 Date: 2014-12-02 License: GNU General Public License Version 2 or later } The important functions in secrlinear are: ll{ read.linearmask import and discretize a linear habitat map (route) networkdistance compute network distances between detectors and points using a linear habitat mask sim.linearpopn simulate population along linear mask make.line place detectors along (part of) a linear route } Other useful functions are: ll{ checkmoves check capthist object for extreme movements showpath interactive examination of network distances clipmask drop mask points outside buffer distance rbind.linearmask combine two linear masks subset.linearmask select part of a linear mask asgraph convert linear mask to igraph snapPointsToLinearMask closest point on graph make.sldf convert coordinates to SpatialLinesDataFrame } Documentation is provided in a vignette ../doc/secrlinear-vignette.pdf and in the pdf version of the help pages ../doc/secrlinear-manual.pdf The package draws on the packages sp (Pebesma and Bivand 2005) and igraph (Csardi and Nepusz 2006). In order to fit a linear-habitat model with the secr function secr.fit:
  1. specify a linear mask for the `mask' argument
  2. specifydetails = list(userdist = networkdistance)so thatsecr.fituses network distances rather than Euclidean distances.
An example dataset arvicola is drawn from trapping of water voles Arvicola amphibius in June 1984 along the River Glyme in the U.K. -- the relevant linear mask is glymemask. A more complex linear network (Silverstream) is provided as an ESRI shapefile.

References

Csardi, G. and Nepusz, T. (2006) The igraph software package for complex network research. InterJournal, Complex Systems 1695. http://igraph.org. Pebesma, E.J. and Bivand, R. S. (2005) Classes and methods for spatial data in R. R News 5(2), http://cran.r-project.org/doc/Rnews/.

See Also

addedges, asgraph, checkmoves, clipmask, deleteedges, linearmask, linearpopn, make.line, make.sldf, networkdistance, plot.linearmask, rbind.linearmask , read.linearmask, showpath, showedges, sim.linearpopn, snapPointsToLinearMask, subset.linearmask

Examples

Run this code
## Water voles in June 1984 on the R. Glyme in Oxfordshire, UK
## capture and trap location files are exactly as for a 2-D analysis

olddir <- setwd(system.file("extdata", package = "secrlinear"))
on.exit(setwd(olddir))
arvicola <- read.capthist("Jun84capt.txt", "glymetrap.txt",
             detector = "multi", covname = "sex")

## Import map of linear habitat
## -- from text file of x-y coordinates
glymemask <- read.linearmask(file = "glymemap.txt", spacing = 4)
## -- from a previously constructed SpatialLinesDataFrame
library(maptools)
SLDF <- readShapeSpatial("glymemap")
glymemask <- read.linearmask(data = SLDF, spacing = 4)

## display the mask and capture data
plot (glymemask)
plot(arvicola, add = TRUE, tracks = TRUE)
plot(traps(arvicola), add = TRUE)

## fit model, estimate density
linearfit <- secr.fit(arvicola, mask = glymemask, trace = FALSE,
    details = list(userdist = networkdistance))
predict(linearfit)

## NOTE : the unit of density (D) is animals / km

Run the code above in your browser using DataLab