Description Usage Arguments Value Author(s) See Also Examples
Convert a habitat mask produced by secr to the form needed for JAGS analysis.
1 | convertMask(secrmask, secrtraps, plot = TRUE)
|
secrmask |
An object of class |
secrtraps |
An object of class |
plot |
If TRUE, the resulting mask and trap locations will be plotted. |
An object of class JAGSmask
, a list with the following elements:
habMat |
A 1/0 matrix, |
trapMat |
A 2-column matrix with the x and y coordinates of the traps in the same units as |
upperLimit |
A length 2 vector giving the upper limit of x and y for |
pixelWidth |
The width and height of the cells in |
area |
The area of suitable habitat in the original units, typically square metres. |
It will also have the following attributes, which can be used to convert JAGS output back to the original coordinate system:
boundingbox |
A 4x2 matrix with coordinates of the 4 corners of |
origin |
A vector of length 2 giving the location in the original coordinates of point 0, 0 in pixel units. |
pixelWidth |
The width and height of the cells in |
The pixelWidth
attribute will be removed in future versions.
Mike Meredith
1 2 3 4 5 6 7 8 9 10 11 12 13 | require(sp)
data(simSCR)
plot(simSCR$patchSP)
points(simSCR$traps, pch=3, col='red')
# Create the 'secr' mask:
require("secr")
secrmask <- make.mask(simSCR$traps, spacing=1000,
type='polygon', poly=simSCR$patchSP)
plot(secrmask)
# Convert to 'JAGSmask' format:
mymask <- convertMask(secrmask, simSCR$traps, plot=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.