Spatially Explicit Capture–Recapture for Linear Habitats
An secr add-on package for linear habitat models.
Package: | secr |
Type: | Package |
Version: | 1.1.4 |
Date: | 2021-05-04 |
License: | GNU General Public License Version 2 or later |
The important functions in secrlinear are:
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:
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
:
specify a linear mask for the ‘mask’ argument
specify details = list(userdist = networkdistance)
so
that secr.fit
uses network distances rather than Euclidean distances.
A more complex linear network (Silverstream) is provided as an ESRI shapefile.
Murray Efford murray.efford@otago.ac.nz
Csardi, G. and Nepusz, T. (2006) The igraph software package for complex network research. InterJournal, Complex Systems 1695. https://igraph.org/.
Pebesma, E.J. and Bivand, R. S. (2005) Classes and methods for spatial data in R. R News 5(2), https://cran.r-project.org/doc/Rnews/.
## 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 inputdir <- system.file("extdata", package = "secrlinear") arvicola <- read.capthist(captfile = paste0(inputdir, "/Jun84capt.txt"), trapfile = paste0(inputdir, "/glymetrap.txt"), detector = "multi", covname = "sex") ## Import map of linear habitat ## -- from text file of x-y coordinates glymemask <- read.linearmask(file = paste0(inputdir, "/glymemap.txt"), spacing = 4) ## -- from a previously constructed SpatialLinesDataFrame library(rgdal) SLDF <- rgdal::readOGR(dsn = paste0(inputdir,"/glymemap.shp"), layer = "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
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.