Description Usage Arguments Details Value Examples
View source: R/pairwise_correlations.R
Pairwise correlations can be used to determine leader follower relationships. Nagy et al. Nature (464) 2010 used directional correlations, this function allows for speed correlations.
1 | calc_speed_lag(tracks, range = 100, time_bin = NULL)
|
tracks |
A tracks object. |
range |
The range of frames for which lags should be calculated, e.g. 100 means from lags from -100 to +100 are evaluated. |
time_bin |
Size of time bins in frames (optional). If supplied, for each of these time bins, a seperate lag correlation will be calculated, allowing you to see if the relationships change over the course of the trials. |
This function returns two variables per animal pair per trial;
lag
is the delay where the correlation was maximal (positive means),
and cor
is the magnitude of the correlation.
A data.frame.
1 2 3 4 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.