make.traps {secr} | R Documentation

## Build Detector Array

### Description

Construct a rectangular array of detectors (trapping grid) or a circle of detectors or a polygonal search area.

### Usage

    make.grid(nx = 6, ny = 6, spacex = 20, spacey = 20, spacing = NULL, detector = "multi",
        binomN = 0, 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))

    make.transect (transectlist = NULL, x = c(-50,-50,50,50), y = c(-50,50,50,-50))

### Arguments

`nx` | number of columns of detectors
`ny` | number of rows of detectors
`spacex` | distance between detectors in 'x' direction (nominally in metres)
`spacey` | distance between detectors in 'y' direction (nominally in metres)
`spacing` | distance between detectors (x and y directions)
`detector` | character value for detector type - 'single', 'multi' etc.
`binomN` | maximum value when detector == 'count'
`originxy` | vector origin for x-y coordinates
`hollow` | logical for hollow grid
`ID` | character string to control row names
`n` | number of detectors
`radius` | radius of circle (nominally in metres)
`IDclockwise` | logical for numbering of detectors
`polylist` | list of dataframes with coordinates for polygons
`transectlist` | list of dataframes with coordinates for transects
`x` | x coordinates of vertices
`y` | y coordinates of vertices

### Details

`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

`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.

### Value

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.

### Note

Several methods are provided for manipulating detector arrays - see `traps`.

### Author(s)

Murray Efford murray.efford@otago.ac.nz

### References

Efford, M.G. (2007) Density 4.1: software for spatially explicit capture–recapture. Department of Zoology, University of Otago, Dunedin, New Zealand. http://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.

### See Also

`read.traps`,`detector`, `print.traps`, `plot.traps`, `traps`

### Examples

    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, lab = TRUE, offset = 7,
            gridl = FALSE)
    }

    temptrap <- make.grid(nx = 7, ny = 5, hollow = TRUE)
    plot (temptrap, border = 10, lab = TRUE, gridl = FALSE)

    plot(make.circle(n = 20, spacing = 30), lab = TRUE, offset = 9)
    summary(make.circle(n = 20, spacing = 30))

[Package secr version 1.3.0 Index]