Title: | Calculate Indices of Dynamic Interaction for Wildlife Tracking Data |
---|---|
Description: | Dynamic interaction refers to spatial-temporal associations in the movements of two (or more) animals. This package provides tools for calculating a suite of indices used for quantifying dynamic interaction with wildlife telemetry data. For more information on each of the methods employed see the references within. The package (as of version >= 0.3) also has new tools for automating contact analysis in large tracking datasets. The package (as of version 1.0) uses the 'move2' class of objects for working with tracking dataset. |
Authors: | Jed Long [aut, cre] |
Maintainer: | Jed Long <[email protected]> |
License: | GPL-3 |
Version: | 1.0.1 |
Built: | 2025-01-25 04:36:40 UTC |
Source: | https://github.com/jedalong/wildlifedi |
This function measures the dynamic interaction between two moving objects following the methods first described by Cole (1949), and more recently employed by Bauman (1998).
Ca(traj, traj2, tc = 0, dc = 0)
Ca(traj, traj2, tc = 0, dc = 0)
traj |
an object of the class |
traj2 |
(optional) same as traj, but for the second group of individuals. See |
tc |
temporal tolerance limit (in seconds) for defining when two fixes
are simultaneous or together. Parameter passed to function |
dc |
distance tolerance limit (in appropriate units) for defining when two fixes are spatially together. |
This function can be used to calculate the Cole (1949) measure of dynamic interaction between two animals. Termed a coefficient of association, the Ca statistic tests the number of fixes the animals are observed together against the total number of fixes following:
where (respectively
) is the number of times animal 1 (resp. 2) are
observed, and
is the number of times the two animals are observed together.
Several works, including Bauman (1998) have suggested that Ca > 0.5 indicates
affiliation or fidelity, while Ca < 0.5 indicates no association between the
two animals. Note that this function calls
GetSimultaneous
to identify the temporal
component of identifying when fixes together.
This function returns a numeric result of the Ca statistic for each pair in the dataset.
Bauman, P.J. (1998) The Wind Cave National Park elk herd: home ranges, seasonal movements, and alternative control methods.
M.S. Thesis. South Dakota State University, Brookings, South Dakota, USA.
Cole, L.C. (1949) The measurement of interspecific association. Ecology. 30, 411–424.
GetSimultaneous, Prox, HAI
data(deer) #tc = 7.5 minutes, dc = 50 meters Ca(deer, tc = 7.5*60, dc = 50)
data(deer) #tc = 7.5 minutes, dc = 50 meters Ca(deer, tc = 7.5*60, dc = 50)
The function checkTO
is a simple function for identifying if, and for how long, two telemetry datasets overlap (temporally) with each other. The function returns a dataframe with5 columns of information: the ids of the first an second individuals in a dyad, a logical variable indicating if the two trajectories overlap temporally, and timings of the beginning and end of the overlap period. If only a single move2 object is provided it considers all pairwise dyads within that move2 object. If two move2 objects are passed in it considers only the dyad pairs from traj against traj2. This can be used to test only the pairwise dyads between two groups (e.g., inter-species).
checkTO(traj, traj2)
checkTO(traj, traj2)
traj |
an object of the class |
traj2 |
(optional) an object of the class |
The function checkTO
can be used to identify if, when, and for how long the tracking data of two individuals overlap temporally.
A data.frame
of with five columns, ID1, ID2, TO (logical indicating if the two tracking dataset overlap temporally), the beginning (tmin
), and end (tmax
) of the overlap period, stored as POSIX
objects.
GetSimultaneous, GetTO
data(does) dyads <- checkTO(does)
data(does) dyads <- checkTO(does)
Calculate the net-displacement (distance) of fixes before and after a contact phase from the nearest contact pahse in time.
conDisplacement(traj, def = "all")
conDisplacement(traj, def = "all")
traj |
an object of the class |
def |
how to define the point-of-contact. The default is to define it as all fixes in a phase |
This function is used to compute the net displacement away from contacts by an animal before and after a contact phase. Net displacement represents an important variable related to the movement of the individual.
An move2 object with a new 'contact_displacement' column indicating the straight-line distance to the nearest (in time) contact phase (defined using parameter def). If there are no contacts associated with an individual the contact displacement is NA.
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.
conProcess, conPhase, conTimelag
## Not run: data(does) doecons <- conProcess(does,tc=15*60,dc=50) doephas <- conPhase(doecons,pc=60*60) disp_f <- conDisplacement(doephas,def='first') disp_l <- conDisplacement(doephas,def='last') ## End(Not run)
## Not run: data(does) doecons <- conProcess(does,tc=15*60,dc=50) doephas <- conPhase(doecons,pc=60*60) disp_f <- conDisplacement(doephas,def='first') disp_l <- conDisplacement(doephas,def='last') ## End(Not run)
Computes phases where contacts occur based on a temporal tolerance.
conPhase(traj, pc = 0)
conPhase(traj, pc = 0)
traj |
an object of the class |
pc |
time (in seconds) to allow for which to combine contact events (see details). |
This function is used following the conProcess
function to arrange contacts into phases where continuous contact occurs (based on the user-defined time threshold pc
. The idea is that we can consider a phase to be a continuous contact event (based on dc
see conProcess
) as long as the contact is only interrupted for no more than pc
time units.
An move2
object with new column contact_pha
.
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.
conProcess, conSpatial, conTemporal, conSummary
## Not run: data(does) doecons <- conProcess(does,tc=15*60,dc=50) doephas <- conPhase(doecons,pc=60*60) ## End(Not run)
## Not run: data(does) doecons <- conProcess(does,tc=15*60,dc=50) doephas <- conPhase(doecons,pc=60*60) ## End(Not run)
This function performs basic contact analysis between individuals in a group of tracked animals, or between two different groups of tracked animals.
conProcess(traj, traj2, dc = 0, tc = 0, GetSim = TRUE, fixid, return = "move2")
conProcess(traj, traj2, dc = 0, tc = 0, GetSim = TRUE, fixid, return = "move2")
traj |
an object of the class |
traj2 |
(optional) same as traj, but for the second group of individuals. See |
dc |
distance tolerance limit (in appropriate units) for defining when two fixes are spatially together. |
tc |
time threshold for determining simultaneous fixes – see function: GetSimultaneous. |
GetSim |
(logical) whether or not to use GetSimultaneous to time match fixes between pairs of individuals. Default = TRUE. |
fixid |
(optional) a column providing unique fix ID's or if not specified one is created by combining the track ID with the fix number for that individual (e.g., "Leroy_107"). |
return |
What to return (one of 'move2' (default) or 'contacts'). See Return below. |
This function can be used to identify all fixes defined as contacts in space and time between individuals in one or two groups.
If return = 'move2' (the default) this function returns the input traj move2 object with additional columns: contact - (binary) whether or not a fix is a contact, contact_id - the id of the individual with which a contact occurs, contact_d - the proximity distance of the contact, contact_dt - the difference in time between the two fixes in the contact, contact_n - the number of contacts at that time. In the event that there is more than one contact for a given fix, the contact_id, contact_d, and contact_dt values are all associated with the most proximal (in geographical space) contact. If return = 'contacts' this function returns a data.frame with the columns: (id1,id2) the id's of the individuals involved in a contact, the unique fix id's from the original data associated with each of the fixes involved in a contact (see parameter fixid), the times of the contact fixes, (dist) the distance between the two fixes associated with the contact, and (difftime) the difference in time between the two fixes involved in the contact.
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.
GetSimultaneous, dcPlot, conPhase
## Not run: data(does) doecons <- conProcess(does,tc=15*60,dc=50) ## End(Not run)
## Not run: data(does) doecons <- conProcess(does,tc=15*60,dc=50) ## End(Not run)
Computes the time-lag from the nearest contact phase.
conTimelag(traj, def = "all")
conTimelag(traj, def = "all")
traj |
an object of the class |
def |
how to define the point-of-contact. The default is to define it as all fixes in a phase |
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.
A move2 object with an additional column contact_timelag with the time to the nearest (in time) contact phase. Negative values indicate times prior to the nearest contact phase and postive values indicate times after the nearest contact phase. If an individual has no contacts, the contact time-lag is NA.
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.
conPhase, conProcess, conDisplacement
## Not run: data(does) doecons <- conProcess(does,tc=15*60,dc=50) doephas <- conPhase(doecons,pc=60*60) conTL_first <- conTimelag(doephas,def='first') conTL_all <- conTimelag(doephas,def='all') ## End(Not run)
## Not run: data(does) doecons <- conProcess(does,tc=15*60,dc=50) doephas <- conPhase(doecons,pc=60*60) conTL_first <- conTimelag(doephas,def='first') conTL_all <- conTimelag(doephas,def='all') ## End(Not run)
The function Cr
computes the correlation statistic for movement data as presented
in the paper by Shirabe (2006). The statistic is essentially a Pearson product-moment
correlation statistic formulated for use with movement data.
Cr(traj, traj2, tc = 0)
Cr(traj, traj2, tc = 0)
traj |
an object of the class |
traj2 |
(optional) same as traj, but for the second group of individuals. See |
tc |
time threshold for determining simultaneous fixes – see function: |
The function Cr
can be used to measure the level of dynamic interaction (termed correlation)
between a pair of simultaneously moving objects. The statistic is sensitive to
interaction in both movement direction (azimuth) and displacement, but is unable to
disentangle the effects of these components.
NOTE: This function is only appropriate with projected coordinates.
This function returns the Shirabe (2006) correlation statistic for two moving objects.
Shirabe, T. 2006. Correlation analysis of discrete motions. In: Raubal, M., Miller, HJ, Frank, AU, and Goodchild, M. eds. GIScience 2006, LNCS 4197. Berlin: Springer-Verlag; 370-382.
GetSimultaneous, DI
data(deer) #tc = 7.5 minutes Cr(deer, tc = 7.5*60)
data(deer) #tc = 7.5 minutes Cr(deer, tc = 7.5*60)
The function Cs
computes the coefficient of sociality between two moving
objects following the methods outlined by Kenward et al. (1993). It also uses a
signed Wilcoxon-rank test to test for significance.
Cs(traj, traj2, tc = 0)
Cs(traj, traj2, tc = 0)
traj |
an object of the class |
traj2 |
(optional) same as traj, but for the second group of individuals. See |
tc |
time threshold for determining simultaneous fixes – see function: |
This function can be used to calculate the Kenward et al. (1993) coefficient of sociality (Cs) between two animals. The Cs statistic tests the observed mean distance between simultaneous fixes against that expected by the overall distribution of distances between all fixes.
Where is the mean observed distance between simultaneous fixes, and
is the mean expected distance between all fixes. Kenward et al. (1993) propose Cs
as a useful metric for exploring attraction or avoidance behaviour.
Values for Cs closer to 1 indicate
attraction, while values for Cs closer to -1 indicate avoidance. Values of Cs
near 0 indicate that the two animals' movements have no influence on one another.
Further, the difference between the observed and expected distances are compared
using a paired signed-rank test (both one-sided tests, indicative of attraction
or avoidance). See the function GetSimultaneous
for details on how
simultaneous fixes are determined from two trajectories.
This function returns a list of objects representing the calculated values from the Cs statistic and associated p-values from the signed rank test.
Do – The mean distance of simultaneous fixes.
De – The mean expected distance, from all fixes.
Cs – The coefficient of sociality, see Details.
p.Attract – One sided p-value from signed rank test, testing for attraction.
p.Avoid – One sided p-value from signed rank test, testing for avoidance.
Kenward, R.E., Marcstrom, V. and Karlbom, M. (1993) Post-nestling behaviour in goshawks, Accipiter gentilis: II. Sex differences in sociality and nest-switching. Animal Behaviour. 46, 371–378.
GetSimultaneous
data(deer) #tc = 7.5 minutes Cs(deer, tc = 7.5*60)
data(deer) #tc = 7.5 minutes Cs(deer, tc = 7.5*60)
This function is an exploratory tool to examine the pairwise distances between individuals within a large telemetry dataset.
dcPlot(traj, traj2, tc = 0, histplot = TRUE, dmax)
dcPlot(traj, traj2, tc = 0, histplot = TRUE, dmax)
traj |
an object of the class |
traj2 |
(optional) same as traj, but for the second group of individuals. See |
tc |
time threshold for determining simultaneous fixes – see function: |
histplot |
(logical) whether to output a histogram, along with a list of the natural breaks in the histogram ( |
dmax |
(optional) distance value to 'cut-off' the distance histogram. |
The dcPlot function can be used to study the frequency distribution of pairwise distances between individual in a large telemetry dataset. It can be applied to a single group (if mtraj2
is ignored) or two-groups of individuals. The code attempts to find natural breaks (local minima) in the frequency histogram using an approach based on the peaks
function attributed to B. Ripley (see https://stackoverflow.com/questions/6324354/add-a-curve-that-fits-the-peaks-from-a-plot-in-r ). This tool is meant to be used for exploratory data analysis.
If histplot = TRUE
a list of the natural breaks (local minima) identified from the frequency histogram and a plot of the frequency histogram.
If histplot = FALSE
a dataframe containing all the pairwise and simultaneous distances between all individuals in the trajectory dataset.
GetSimultaneous, conProcess, Prox, Don, IAB
## Not run: data(does) dcPlot(does,tc=15*60,dmax=1000) ## End(Not run)
## Not run: data(does) dcPlot(does,tc=15*60,dmax=1000) ## End(Not run)
GPS telemetry data for two male deer during a one-week period in March 2005. The two deer form a male bachelor group, making them an interesting case study for studying dynamic interaction patterns. The data are a subset of the data used as a case study in Long et al. (2014).
An ltraj
object with two bursts, representing the two different individual deer:
Deer no. 37 containing 551 fixes.
Deer no. 38 containing 567 fixes.
The deer data are stored as a single 'ltraj'
object; two bursts contain the fixes for two
individuals (deer37 and deer 38). GPS fixes were attempted at a regular sampling frequency of 15 minutes.
For more information on these data how the deer data was collected or for citation please see the papers
Webb et al. (2009, 2010).
Long, J.A., Nelson, T.A., Webb, S.L., Gee, K.L. (2014) A critical examination
of indices of dynamic interaction for wildlife telemetry studies. Journal
of Animal Ecology, 83: 1216-1233.
Webb, S.L., Gee, K.L., Demarais, S., Strickland, B.K., DeYoung, R.W.
(2009) Efficacy of a 15-strand high-tensile electric fence to control
white-tailed deer movements. Wildlife Biology in Practice, 5, 45-57.
Webb, S.L., Gee, K.L., Strickland, B.K., Demarais, S., DeYoung, R.W.
(2010) Measuring fine-scale white-tailed deer movements and environmental
influences using GPS collars. International Journal of Ecology,
2010, 1-12.
data(deer) deer37 <- deer[1] deer38 <- deer[2] plot(deer37) plot(deer38)
data(deer) deer37 <- deer[1] deer38 <- deer[2] plot(deer37) plot(deer38)
The function DI
measures dynamic interaction between two moving objects. It
calculates the local level di statistic for movement displacement, direction,
and overall. DI can compute time- and/or distance-based weighting schemes
following Long and Nelson (2013).
DI(traj, traj2, tc = 0, local = FALSE, rand = 0, alpha = 1)
DI(traj, traj2, tc = 0, local = FALSE, rand = 0, alpha = 1)
traj |
an object of the class |
traj2 |
(optional) same as traj, but for the second group of individuals. See |
tc |
time threshold for determining simultaneous fixes – see function: |
local |
logical value indicating whether a dataframe ( |
rand |
number of permutations to use in the local permutation test. |
alpha |
value for the |
This function can be used for calculating the dynamic interaction (DI) statistic as described in Long and Nelson (2013). The DI statistic can be used to measure the local level of dynamic interaction between two moving objects. Specifically, it measures dynamic interaction in movement direction and displacement.
If local=FALSE
(the default) DI returns the numeric value of the DI index (along with DI and DI
), and the associated p-value from a permutation test (see
IAB
).
If local=TRUE
DI returns a large dataframe that contains the localized di
values as a column (see Long and Nelson 2013). The columns for di
, di.theta
, and di.d
represent dynamic interaction overall, in direction (azimuth), and in displacement, respectively for each segment. A localized p-value for a one sided test for positive interaction (and z-score) is computed based on rand
permutations of the segments. The row.name columns can be used to match the simultaneous segments to the original trajectory (see IAB
).
Long, J.A., Nelson, T.A. 2013. Measuring dynamic interaction in movement data. Transactions in GIS. 17(1): 62-77.
GetSimultaneous, Cr, IAB
## Not run: data(deer) #tc = 7.5 minutes DI(deer, tc = 7.5*60) df <- DI(deer, tc = 7.5*60, local = TRUE) ## End(Not run)
## Not run: data(deer) #tc = 7.5 minutes DI(deer, tc = 7.5*60) df <- DI(deer, tc = 7.5*60, local = TRUE) ## End(Not run)
GPS telemetry data for 8 does during month of May in 2011.
An ltraj
object with where bursts represent different individual deer.
The doe data are stored as a single 'ltraj'
object; each burst represents an individual.
data(does) plot(does)
data(does) plot(does)
The function Don
measures the dynamic interaction between two moving objects following
the methods outlined by Doncaster (1990).
Don(traj, traj2, tc = 0, dc = 0, plot = TRUE)
Don(traj, traj2, tc = 0, dc = 0, plot = TRUE)
traj |
an object of the class |
traj2 |
(optional) same as traj, but for the second group of individuals. See |
tc |
time threshold for determining simultaneous fixes – see function: |
dc |
distance tolerance limit (in appropriate units) for defining when two fixes are spatially together. |
plot |
logical, whether or not to plot the Doncaster plot. Default = TRUE. |
This function can be used to compute the Doncaster (1990) methods for measuring
dynamic interaction between two objects. The Doncaster method tests the proportion
of simultaneous fixes that are below dc
against that which would be
expected based on the distribution of distances between all fixes.
A data.frame is returned that contains the values for the contingency table of simultaneous fixes (paired) and non-paired fixes below and above dc
, along with the associated p-value from the Chi-squared test.This function can optionally return a plot, for distance values ranging from 0 to the maximum distance separating two fixes, of the observed proportion of simultaneous fixes below each distance value (for each pair). The expected values based on all fixes are also included.
Doncaster, C.P. (1992) Non-parametric estimates of interaction from radio-tracking data. Journal of Theoretical Biology, 143: 431-443.
GetSimultaneous
data(deer) #tc = 7.5 minutes, dc = 50 meters Don(deer, tc = 7.5*60, dc = 50)
data(deer) #tc = 7.5 minutes, dc = 50 meters Don(deer, tc = 7.5*60, dc = 50)
The function GetSimultaneous
identifies and extracts simultaneous fixes,
within a given tolerance limit, between two movement trajectories.
GetSimultaneous(traj1, traj2, tc = 0)
GetSimultaneous(traj1, traj2, tc = 0)
traj1 |
an object of the class |
traj2 |
same as |
tc |
time threshold for determining simultaneous fixes. For simplicity, |
This function is used to determine the simultaneous fixes between two movement datasets facilitating further analysis.
A move2
object containing two individuals, representing the two original move2
objects, each containing only those fixes that are deemed simultaneous.
GetTO
library(move2) data(deer) deer37 <- deer[mt_track_id(deer) == '37',] deer38 <- deer[mt_track_id(deer) == '38',] deer_sim <- GetSimultaneous(deer37, deer38, tc = 7.5*60) table(deer$id) table(deer_sim$id)
library(move2) data(deer) deer37 <- deer[mt_track_id(deer) == '37',] deer38 <- deer[mt_track_id(deer) == '38',] deer_sim <- GetSimultaneous(deer37, deer38, tc = 7.5*60) table(deer$id) table(deer_sim$id)
The function GetTO
identifies and extracts fixes of a tracking dataset that overlap in time with all other trajectories.
GetTO(traj, tb = 0)
GetTO(traj, tb = 0)
traj |
an object of the class |
tb |
(optional) time threshold (i.e., time buffer) for considering if fixes are in the overlap period (in seconds). |
This function is used to determine the fixes that overlap in time between two trajectories.
A single move2
object containing the fixes from traj that temporally overlap. If more than 2 individuals it will take the maximum of the earliest start-time from all individuals and minimum of the latest end-time of all individuals.
checkTO
data(deer) deer_to <- GetTO(deer)
data(deer) deer_to <- GetTO(deer)
This function computes the Half-weight Association Index for examining the presence of dynamic interaction in wildlife telemetry studies. This implementation follows that outlined in the paper Atwood and Weeks (2003).
HAI(traj, traj2, hr = NULL, tc = 0, dc = 50)
HAI(traj, traj2, hr = NULL, tc = 0, dc = 50)
traj |
an object of the class |
traj2 |
(optional) same as traj, but for the second group of individuals. See |
hr |
(optional)spatial polygon |
tc |
time threshold for determining simultaneous fixes – see function: |
dc |
distance tolerance limit (in appropriate units) for defining when two fixes are spatially together. |
This function can be used to test for the presence of dynamic interaction within the shared area (often termed the overlap zone) of the two animals home ranges. Specifically, HAI is calculated in identical fashion to that for Ca
, but considers only those fixes in the shared area. Typically, the overlap zone (OZ) is easily obtained by taking the spatial intersection of two polygon home ranges.
This function returns the numeric value of the HAI statistic. Values near 1 indicate attraction within the shared home range area, while values near 0 indicate avoidance within this shared area.
Atwood, T.C. and Weeks Jr., H.P. (2003) Spatial home-range overlap and temporal
interaction in eastern coyotes: The influence of pair types and fragmentation.
Canadian Journal of Zoology, 81: 1589-1597.
GetSimultaneous, Ca
## Not run: data(deer) #uses as a default minimum convex polygon for home range... #tc = 7.5 minutes, dc = 50 meters HAI(deer, tc=7.5*60, dc=50) ## End(Not run)
## Not run: data(deer) #uses as a default minimum convex polygon for home range... #tc = 7.5 minutes, dc = 50 meters HAI(deer, tc=7.5*60, dc=50) ## End(Not run)
The function IAB
computes the IAB index following the methods described in the paper by
Benhamou et al. (2014). It facilitates global analysis, with the significance testing procedure
described in the paper, but also a local level output, to explore the IAB statistic through time.
IAB(traj, traj2, tc = 0, dc = 0, local = FALSE, rand = 99)
IAB(traj, traj2, tc = 0, dc = 0, local = FALSE, rand = 99)
traj |
an object of the class |
traj2 |
(optional) same as traj, but for the second group of individuals. See |
tc |
time threshold for determining simultaneous fixes – see function: |
dc |
critical distance where the IAB function will show maximum slope – see Benhamou et al. (2014) for more advice on selecting this parameter. |
local |
logical value indicating whether a dataframe ( |
rand |
number of permutations to use in the local permutation test. |
The function IAB
can be used to test for direct interaction in wildlife telemetry data and affords a novel significance testing procedure that takes into account the serially correlated structure of telemetry data. Specifically, it computes an index analogous to the Bhattacharyya coefficient between the potential influence domains of two animals. Like the other indices, IAB is dependent on the selection of an appropriate value for dc
(which is termed in the article). The
dc
parameter here is not a threshold distance, but rather the distance at which the function shows maximum slope (see Benhamou et al. 2014).
The significance testing procedure uses a wrapped shifting method in order to maintain the serially correlated structure of the data. At each shift, a sample value of IAB (termed MAB) is computed in order to generate a distribution of values to test against (for more information see Benhamou et al. 2014). Here a local version of this statistical testing procedure is implemented by taking rand
samples of the permutations of unpaired fixes. The p-values are computed following Benhamou et al. (2014), z-scores are calculated based on the mean and standard deviation of this hypothetical distribution.
If local=FALSE
(the default) IAB returns a dataframe with the values of the IAB index and the associated p-values for one-sided tests for attraction or avoidance. If local=TRUE
IAB returns a dataframe (containing the date/times of all simultaneous fixes (NOTE: times are associated with traj1), along with the distance between fixes at each time , and the IAB index value for each simultaneous fix. A localized p-value (.pa signifies the test for attraction and pb the test for avoidance) and z-score is computed based on rand
permutations of the fixes. The row.name columns can be used to match the simultaneous fixes to the original trajectory.
Benhamou, S., Valeix, M., Chamaille-Jammes, S., Macdonald, D., Loveridge, A.J. (2014) Movement-based analysis of interactions in African lions. Animal Behaviour, 90: 171-180.
GetSimultaneous, DI, Prox
data(deer) #tc = 7.5 minutes, dc = 50 meters IAB(deer, tc=7.5*60, dc=50) df <- IAB(deer, tc=7.5*60, dc=50, local=TRUE)
data(deer) #tc = 7.5 minutes, dc = 50 meters IAB(deer, tc=7.5*60, dc=50) df <- IAB(deer, tc=7.5*60, dc=50, local=TRUE)
The function Lixn
measures dynamic interaction between two animals following
the methods outlined by Minta (1992).
Lixn(traj, traj2, method = "spatial", tc = 0, hr = NULL, OZ = NULL)
Lixn(traj, traj2, method = "spatial", tc = 0, hr = NULL, OZ = NULL)
traj |
an object of the class |
traj2 |
(optional) same as traj, but for the second group of individuals. See |
method |
method for computing the marginal distribution from which expected
values are computed. If |
tc |
time threshold for determining simultaneous fixes – see function: |
hr |
(optional) spatial polygon |
OZ |
(– required if method = 'frequency') A |
The function Lixn
can be used to calculate the Minta (1992) measures of dynamic
interaction between two animals. The Minta statistic tests how the two animals simultaneously utilize
an area shared between the two individuals. Three coefficients are produced ,
,
and
. Each of these statistics are based on a contingency table that compares the observed
frequency of those fixes that are simultaneous and within/outside the shared area to expectations based on
area overlap proportions (if
method="spatial"
) or expectations derived from all fixes (if
method="frequency"
) – see Minta (1992) for more details. A Chi-squared statistic can then
be used to examine the significance between the observed and expected use of the shared area.
Minta (1992) suggests the following interpretations of the coefficients. When
is near 0, the first animal's use of the shared area is random (or as expected). When
it signifies spatial attraction to the shared area, or greater than
expected use. When
it signifies spatial avoidance of the shared area, or
less than expected use. Interpretation of
is the same as for
with
respect to the second animal.
tells us far more about the nature of the
interaction between the two individuals. As
nears 0, both animals use the
shared area randomly, with regards to the other animal. If
the animals
use the shared area more simultaneously, whereas if
it is an
indication of solitary use, or avoidance. This is why
is termed the temporal
interaction coefficient. A Chi-squared test can be used to identify the significance
of the
,
, and
values.
NOTEs:
1. With modern telemetry datasets, where home ranges are readily estimated, choosing method = 'spatial'
is most appropriate. If parmater hr
is not specified, the code uses the minimum convex hull method to calculate individual
home ranges.
2. When the home ranges do not overlap the Lixn statistic is not defined and the function returns a
string of NA's.
3. When one home range completely encloses another the Lixn statistic is not defined and the function returns
a string of NA's and 'ContainsB'
(or 'ContainsB'
) under the p.IXN result.
4. Further to points 2 and 3, the Lixn statistic is not appropriate in situations where the overlap area is
either very large or very small relative to either home range (i.e., a situation with almost complete enclosure
or virtually no overlap). The example data (deer) is an exampl of a near complete enclosure. Thus, it is advised
that Lixn
be used only in situations where there are suitable marginal areas for areaA, areaB, and areaAB
– see Minta (1992).
This function returns a data.frame with values representing the calculated statistical values and associated p-values from the Chi-squared test for each dyad.
pTable – contingency table showing marginal probabilities of expected use
based on the selection of the method
parameter.
nTable – contingency table showing observed frequency of use of the shared area based on simultaneous fixes.
oTable – the odds for each cell in the contingency table.
Laa – the calculated value of the statistic
p.AA – the associated p-value
Lbb – the calculated value of the statistic
p.BB – the associated p-value
Lixn – the calculated value of the statistic
p.IXN – the associated p-value
Minta, S.C. (1992) Tests of spatial and temporal interaction among animals. Ecological Applications, 2: 178-188
GetSimultaneous
## Not run: data(deer) #tc = 7.5 minutes, dc = 50 meters Lixn(deer, method='spatial', tc=7.5*60) #use internal buffer 500m of MCP for demonstration of frequency method # NOTE: This is just an example, this is not an appropriate way to define overlap zone. idcol <- mt_track_id_column(deer) deercore <- deer |> st_union() |> st_convex_hull() |> st_buffer(-500) Lixn(deer, method='frequency', tc=7.5*60, OZ=deercore) ## End(Not run)
## Not run: data(deer) #tc = 7.5 minutes, dc = 50 meters Lixn(deer, method='spatial', tc=7.5*60) #use internal buffer 500m of MCP for demonstration of frequency method # NOTE: This is just an example, this is not an appropriate way to define overlap zone. idcol <- mt_track_id_column(deer) deercore <- deer |> st_union() |> st_convex_hull() |> st_buffer(-500) Lixn(deer, method='frequency', tc=7.5*60, OZ=deercore) ## End(Not run)
The function ltraj_move2
is a simple function for quickly converting ltraj
to move2
objects.
ltraj_move2(ltraj)
ltraj_move2(ltraj)
ltraj |
an object of the class |
The function ltraj_move2
can be used to convert an ltraj
object into an move2
object.
A move2
object.
move2_ltraj
data(deer) deer_ltraj <- move2_ltraj(deer) deer_move <- ltraj_move2(deer_ltraj)
data(deer) deer_ltraj <- move2_ltraj(deer) deer_move <- ltraj_move2(deer_ltraj)
The function move2_ltraj
is a simple function for quickly converting move2
to ltraj
objects.
move2_ltraj(traj)
move2_ltraj(traj)
traj |
an object of the class |
The function move2_ltraj
can be used to convert a move2
object into a ltraj
object.
A ltraj
object.
ltraj_move2
data(deer) deer_ltraj <- move2_ltraj(deer)
data(deer) deer_ltraj <- move2_ltraj(deer)
The function Prox
simply computes the proportion of (simultaneous) fixes that are proximal, based on some spatial
threshold – dc
(Bertrand et al. 1996). It also facilitates local-level proximity analysis
Prox(traj, traj2, tc = 0, dc = 50, local = FALSE)
Prox(traj, traj2, tc = 0, dc = 50, local = FALSE)
traj |
an object of the class |
traj2 |
(optional) same as traj, but for the second group of individuals. See |
tc |
time threshold for determining simultaneous fixes – see function: |
dc |
distance tolerance limit (in appropriate units) for defining when two fixes are spatially together. |
local |
logical value indicating. When local = FALSE (the default) prox returns a data.frame with the global proximity ratio (proportion of all fixes below dc and tc) for each pair of individuals. When local = TRUE, prox returns the input move2 object with the distance to the most proximal fix, and the number of fixes that are considered proximal for each fix in the dataset. |
The function Prox
can be used to test for the presence of attraction (via proximity) in wildlife telemetry data. Prox is simply the proportion of simultaneous fixes within the threshold distance – dc
. The local output (dataframe) can be useful for examining variation in proximity through time.
If local=FALSE
(the default) Prox returns the numeric value of the Prox index for each pair of individuals.
If local=TRUE
Prox returns a move2
containing the original trajectory (or both trajectories) with three additional columns prox (the distance to the nearest proximal fix), prox.id (the id of the nearest proximal fix) and prox.n (the number of individuals with proximal fixes)
Bertrand, M.R., DeNicola, A.J., Beissinger, S.R, Swihart, R.K. (1996) Effects of parturition on home ranges and social affiliations of female white-tailed deer. Journal of Wildlife Management, 60: 899-909.
GetSimultaneous, contacts
data(deer) #tc = 7.5 minutes, dc = 50 meters Prox(deer, tc=7.5*60, dc=50) deer <- Prox(deer, tc=7.5*60, dc=50, local=TRUE)
data(deer) #tc = 7.5 minutes, dc = 50 meters Prox(deer, tc=7.5*60, dc=50) deer <- Prox(deer, tc=7.5*60, dc=50, local=TRUE)