Learn R Programming

secr (version 1.3.0)

rbind.capthist: Combine capthist Objects

Description

Form a single capthist object from two or more compatible capthist objects.

Usage

rbind.capthist(..., renumber = TRUE, pool = NULL)
MS.capthist(...)

Arguments

...
one or more simple capthist objects (i.e., single-session)
renumber
assign new composite individual ID: sourceobject.oldID
pool
list of indices

Value

  • An object of class capthist with number of rows equal to the sum of the rows in the input objects.

Details

In its simplest usage, the source objects in ...each provide detection histories from a single session, and the result is a single-session object. For this to work the objects must be compatible. capthist objects are compatible if they use the same detectors (traps) and have consistent covariates and other attributes. If the ...argument includes at least one multi-session capthist object then the elements will be formed into a single multi-session capthist object. If ...is a single multi-session object then the components of pool are used to define combinations of old sessions (e.g. pool = list(1:3, 4:5) forms two new sessions from 5 old ones). Although rbind.capthist looks like an S3 method, it isn't. The full function name must be used. MS.capthist treats each source object as the data for a separate session. Compatibility is not required.

See Also

capthist, subset.capthist

Examples

Run this code
## simulate 2-part mixture
temptrap <- make.grid(nx = 8, ny = 8)
temp1 <- sim.capthist(temptrap, 
    detectpar = list(g0 = 0.1, sigma = 40))
temp2 <- sim.capthist(temptrap, 
    detectpar = list(g0 = 0.2, sigma = 20))
temp3 <- rbind.capthist(temp1, temp2)

## compare mixture to sum of components
## note 'traps visited' is not additive for 'multi' detector
## nor is 'traps set'
(summary(temp1)$counts +  summary(temp2)$counts) -
    summary(temp3)$counts

Run the code above in your browser using DataLab