addSightings: Mark-resight Data

Description Usage Arguments Details Value Warning See Also Examples


Add sighting data on unmarked individuals and/or unidentified marked individuals to an existing capthist object.


addSightings(capthist, unmarked = NULL, nonID = NULL, verify = TRUE, ...)



secr capthist object


matrix or list of matrices of sightings of unmarked animals, or file name (see Details)


matrix or list of matrices of unidentified sightings of marked animals, or file name (see Details)


logical; if TRUE then the resulting capthist object is checked with verify


other arguments passed to read.table


The capthist object for mark-resight analysis comprises distinct marking and sighting occasions, defined in the markocc attribute of traps(capthist). Add this attribute to traps(capthist) with markocc before using 'addSightings'. See also read.traps and read.capthist.

Mark-resight data may be binary (detector type ‘proximity’) or counts (detector types ‘count’, 'polygon' or 'transect'). The detector type is an attribute of traps(capthist). Values in unmarked and nonID should be whole numbers, and may be greater than 1 even for binary proximity detectors because multiple animals may be detected simultaneously at one place.

Arguments unmarked and nonID provide data for attributes ‘Tu’ and ‘Tm’ respectively. They may take several forms

  • a single integer, the sum of all counts*

  • a matrix of the count on each occasion at each detector (dimensions K x S, where K is the number of detectors and S is the total number of occasions). Columns corresponding to marking occasions should be all-zero.

  • for multi-session data, a list with components as above

  • a character value with the name of a text file containing the data; the file will be read with read.table. The ... argument allows some control over how the file is read. The data format comprises at least S+1 columns. The first is a session identifier used to split the file when the data span multiple sessions; it should be constant for a single-session capthist. The remaining S columns contain the counts for occasions 1:S, one row per detector. Further columns may be present; they are ignored at present.

* although this is convenient, the full matrix of counts provides more flexibility (e.g., when you wish to subset by occasion), and enables modelling of variation across detectors and occasions.


A capthist object with the same structure as the input, but with new sighting-related attributes Tu (sightings of unmarked animals) and/or Tm (unidentified sightings of marked animals). Input values, including NULL, overwrite existing values.


** Mark-resight data formats and models are experimental in secr 2.10.0 and subject to change **

See Also

markocc, read.capthist, read.traps, sim.resight, Tm, Tu, secr-markresight.pdf


## Not run: 

## suppose CH is a capthist object with detector type proximity,
## attribute 'markocc' is defined for traps(CH), and 
## unmarkedsightings.txt is a text file with a
## compatible K x S array of non-negative integer values.

Tu <- read.table('unmarkedsightings.txt')
CH2 <- addSightings(CH, unmarked = Tu)

## End(Not run)

Search within the secr package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.