Learn R Programming

secr (version 3.0.1)

join: Combine or Split Sessions of capthist Object

Description

Make a single-session capthist object from a list of single-session objects, or a multi-session capthist object.

Usage

join(object, remove.dupl.sites = TRUE, tol = 0.001) 
unjoin(object, interval, ...)

Arguments

object
list of single-session objects, or a multi-session capthist object [join], or a single-session capthist object [unjoin]
remove.dupl.sites
logical; if TRUE then a single record is retained for each trap site used in multiple input sessions
tol
absolute distance in metres within which sites are considered identical
interval
vector of times between occasions; zero indicates same session
...
other arguments passed to subset.capthist

Value

For join, a single-session capthist object. The vector attribute `interval' records the distinction between occasions that are adjacent in the input (interval = 0) and those that are in consecutive sessions (interval = 1); `interval' has length one less than the number of occasions.

For unjoin, a multi-session capthist object. Sessions are named with integers.

Details

join

The input sessions are assumed to be of the same detector type and to have the same attributes (e.g., covariates should be present for all or none).

The number of occasions (columns) in the output is equal to the sum of the number of occasions in each input.

A new dataframe of individual covariates is formed using the covariates for the first occurrence of each animal.

Attributes xy and signal are handled appropriately, as is trap usage.

unjoin

The input grouping of occasions (columns) into sessions is specified via interval. This is a vector of length one less than the number of occasions (columns) in object. Elements greater than zero indicate a new session.

The interval argument may be omitted if object has a valid `interval' attribute, as in the output from join.

See Also

MS.capthist, rbind.capthist

Examples

Run this code

joined.ovenCH <- join (ovenCH)
summary(joined.ovenCH)
attr(joined.ovenCH, "interval")

summary(unjoin(joined.ovenCH))

Run the code above in your browser using DataLab