Last chance! 50% off unlimited learning
Sale ends in
Construct a rectangular array of detectors (trapping grid) or a circle of detectors or a polygonal search area.
make.grid(nx = 6, ny = 6, spacex = 20, spacey = spacex, spacing = NULL,
detector = "multi", originxy = c(0,0), hollow = F,
ID = "alphay", markocc = NULL)make.circle (n = 20, radius = 100, spacing = NULL,
detector = "multi", originxy = c(0,0), IDclockwise = T, markocc = NULL)
make.poly (polylist = NULL, x = c(-50,-50,50,50),
y = c(-50,50,50,-50), exclusive = FALSE, verify = TRUE)
make.transect (transectlist = NULL, x = c(-50,-50,50,50),
y = c(-50,50,50,-50), exclusive = FALSE)
make.telemetry (xy = c(0,0))
number of columns of detectors
number of rows of detectors
distance between detectors in `x' direction (nominally in metres)
distance between detectors in `y' direction (nominally in metres)
distance between detectors (x and y directions)
character value for detector type - "single", "multi" etc.
vector origin for x-y coordinates
logical for hollow grid
character string to control row names
integer vector of marking or sighting codes; see markocc
number of detectors
radius of circle (nominally in metres)
logical for numbering of detectors
list of dataframes with coordinates for polygons
list of dataframes with coordinates for transects
x coordinates of vertices
y coordinates of vertices
logical; if TRUE animal can be detected only once per occasion
logical if TRUE then the resulting traps object is
checked with verify
vector with coordinates of arbitrary point (e.g., centroid of fixes)
An object of class traps
comprising a data frame of x- and
y-coordinates, the detector type ("single", "multi", or "proximity" etc.),
and possibly other attributes.
make.grid
generates coordinates for nx.ny
traps at
separations spacex
and spacey
. If spacing
is
specified it replaces both spacex
and spacey
. The
bottom-left (southwest) corner is at originxy
. For a hollow grid,
only detectors on the perimeter are retained. By default, identifiers
are constructed from a letter code for grid rows and an integer value
for grid columns ("A1", "A2",...). `Hollow' grids are always numbered
clockwise in sequence from the bottom-left corner. Other values of
ID
have the following effects:
ID | Effect |
numx | column-dominant numeric sequence |
numy | row-dominant numeric sequence |
numxb | column-dominant boustrophedonical numeric sequence (try it!) |
numyb | row-dominant boustrophedonical numeric sequence |
alphax | column-dominant alphanumeric |
alphay | row-dominant alphanumeric |
xy | combine column (x) and row(y) numbers |
`xy' adds leading zeros as needed to give a string of constant length with no blanks.
make.circle
generates coordinates for n traps in a circle centred
on originxy
. If spacing
is specified then it overrides the
radius
setting; the radius is adjusted to provide the requested
straightline distance between adjacent detectors. Traps are numbered
from the trap due east of the origin, either clockwise or anticlockwise
as set by IDclockwise
.
Polygon vertices may be specified with x
and y
in the case
of a single polygon, or as polylist
for one or more polygons. Each
component of polylist
is a dataframe with columns `x' and `y'.
polylist
takes precedence. make.poly
automatically closes
the polygon by repeating the first vertex if the first and last vertices
differ.
Transects are defined by a sequence of vertices as for polygons, except that they are not closed.
make.telemetry
builds a simple traps object for the 'telemetry' detector type. The attribute 'telemetrytype' is set to "independent".
Specialised functions for arrays using a triangular grid are described
separately (make.tri
, clip.hex
).
Efford, M. G. (2012) DENSITY 5.0: software for spatially explicit capture--recapture. Department of Mathematics and Statistics, University of Otago, Dunedin, New Zealand. https://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.
read.traps
,detector
,
trap.builder
,make.systematic
,
print.traps
, plot.traps
,
traps
, make.tri
,
addTelemetry
# NOT RUN {
demo.traps <- make.grid()
plot(demo.traps)
## compare numbering schemes
par (mfrow = c(2,4), mar = c(1,1,1,1), xpd = TRUE)
for (id in c("numx", "numy", "alphax", "alphay", "numxb",
"numyb"))
{
temptrap <- make.grid(nx = 7, ny = 5, ID = id)
plot (temptrap, border = 10, label = TRUE, offset = 7,
gridl = FALSE)
}
temptrap <- make.grid(nx = 7, ny = 5, hollow = TRUE)
plot (temptrap, border = 10, label = TRUE, gridl = FALSE)
plot(make.circle(n = 20, spacing = 30), label = TRUE, offset = 9)
summary(make.circle(n = 20, spacing = 30))
## jitter locations randomly within grid square
## and plot over `mask'
temptrap <- make.grid(nx = 7, ny = 7, spacing = 30)
tempmask <- make.mask(temptrap, buffer = 15, nx = 7, ny = 7)
temptrap[,] <- temptrap[,] + 30 * (runif(7*7*2) - 0.5)
plot(tempmask, dots = FALSE, mesh = 'white')
plot(temptrap, add = TRUE)
# }
Run the code above in your browser using DataLab