rbind.traps {secr} | R Documentation

## Combine traps Objects

### Description

Form a single `traps` object from two or more existing `traps` objects.

### Usage

    ## S3 method for class 'traps'
    rbind(..., renumber = TRUE, addusage, checkdetector = TRUE, suffix = TRUE)

### Arguments

`...` | one or more `traps` objects
`renumber` | logical for whether row names in the new object should be set to the row indices
`addusage` | integer vector; if specified and the inputs lack usage attributes then a binary usage attribute will be generated with the given number of occasions for each input
`checkdetector` | logical; if TRUE then variation in the detector attribute triggers a warning
`suffix` | logical; if TRUE then suffix to the row names indicates source

### Details

An attempt to combine objects will fail if they conflict in their `covariates` attributes. Differences in the `usage` attribute are handled as follows. If `usage` is missing for all inputs and `addusage = TRUE` is specified then usage codes are generated automatically (positive for the specified number of occasions). If `usage` is specified for one input but not other(s), the missing values are constructed assuming all detectors were operated for the maximum number of occasions in any input. If inputs differ in the number of ‘usage’ columns (occasions), the smaller matrices are padded with ‘zero’ columns to the maximum number of columns in any input.

... may be a single multi-session traps object (from 2.10.0).

By default (and always prior to 3.1.1) row names include a suffix (e.g., ".1", or ".2") to indicate the original object (first, second etc.). A suffix is added automatically to all names if any name is duplicated, and a warning is generated.

### Value

An object of class `traps` with number of rows equal to the sum of the rows in the input objects.

### See Also

`traps`, `subset.traps`

### Examples

    ## nested hollow grids
    hollow1 <- make.grid(nx = 8, ny = 8, hollow = TRUE)
    hollow2 <- shift(make.grid(nx = 6, ny = 6, hollow = TRUE),
        c(20, 20))
    nested <- rbind (hollow1, hollow2)
    plot(nested, gridlines = FALSE, label = TRUE)

[Package secr version 3.2.1 Index]