conContext: Examine context associated with contact phases

Description Usage Arguments Details Value See Also Examples

View source: R/conContext.R

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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.

See Also

conPhase

Examples

1
2
3
4
5
6
7
8
## 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 June 16, 2021, 5:07 p.m.