Last chance! 50% off unlimited learning
Sale ends in
make.grid(nx = 6, ny = 6, spacex = 20, spacey = 20, spacing = NULL,
detector = "multi", originxy = c(0,0), hollow = F,
ID = "alphay")
make.circle (n = 20, radius = 100, spacing = NULL,
detector = "multi", originxy = c(0,0), IDclockwise = T)
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 (...)
verify
make.poly
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:
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
.
Specialised functions for arrays using a triangular grid are described
separately (make.tri
, clip.hex
).
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
merely calls make.poly
and assigns
`telemetry' as the detector type of the result.read.traps
,detector
,
print.traps
, plot.traps
,
traps
, make.tri
,
addTelemetry
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)
plot(temptrap, add = TRUE)
Run the code above in your browser using DataLab