conContext: Examine context associated with contact phases

View source: R/conContext.R

conContextR Documentation

Examine context associated with contact phases

Description

Extracts the variables associated with var before, during, and after contact phases, based on some specified time-lag.

Usage

conContext(
  ltraj,
  var = "dist",
  def = "all",
  idcol = "burst",
  nrand = 0,
  nlag = 0,
  lag = 0,
  gap = 0,
  phaid
)

Arguments

ltraj

an object of the class ltraj which should be output from the function conPhase.

var

name(s) (as character) of columns (possibly from infolocs) to keep for contextual analysis.

def

how to define the point-of-contact. The default is to define it as all fixes in a phase def = 'all', alternatively contacts can be defined as a single point along the phase defined as one of: 'first','last','minDist','minTime', which corresponds to the first fix int he contact phase, the last fix in the contact phase, the fix with the minimum time difference and the fix with the closest contact distance.

idcol

column id associated with IDs of individuals, default is the 'burst'.

nrand

number of random fixes to be selected (default = 0).

nlag

number of lags to compute in the before and after phases of a contact. If lag = 0 then only contacts are used.

lag

time (in seconds) for defining the lags in before and after periods of a contact.

gap

time (in seconds) for excluding the lags in before and after periods of a contact.

phaid

(optional) id(s) of the contact phase upon which to examine (default is all).

Details

This function is used following the conphase function. One should choose how to define the contact point (i.e., the parameter contact) depending on the research question. In most typical cases (with regular interval tracking data) the lag time should be set to the tracking interval and the gap should be set to 1/2 the tracking interval.

Value

A dataframe that can be used to examine behaviour/context before, during, and after contact phases.

References

Long, JA, Webb, SL, Harju, SM, Gee, KL (2022) Analyzing Contacts and Behavior from High Frequency Tracking Data Using the wildlifeDI R Package. Geographical Analysis. 54, 648–663.

See Also

conPhase

Examples


## Not run: 
data(does)
doecons <- conProcess(does,tc=15*60,dc=50)
doephas <- conPhase(doecons,pc=60*60)
cc <- conContext(var='dist',def='first',nlag=3,lag=30*60,gap=15*60)
head(cc)

## End(Not run)


wildlifeDI documentation built on Nov. 14, 2023, 1:09 a.m.