LAR | R Documentation |
Calculate lagged association rate g(tau)
from Whitehead (2008)
LAR(group_by_individual, times, timejump, min_time = NULL, max_time = NULL,
identities = NULL, which_identities = NULL, locations = NULL,
which_locations = NULL, start_time = NULL, end_time = NULL, classes = NULL,
which_classes = NULL)
group_by_individual |
a |
times |
K vector of times defining the middle of each group/event |
timejump |
step length for |
min_time |
minimum/starting value of |
max_time |
maximum/ending value of |
identities |
N vector of identifiers for each individual (column) in the group by individual matrix |
which_identities |
vector of identities to include in the network (subset of identities) |
locations |
K vector of locations defining the location of each group/event |
which_locations |
vector of locations to include in the network (subset of locations) |
start_time |
element describing the starting time for inclusion in the network (useful for temporal analysis) |
end_time |
element describing the ending time for inclusion in the network (useful for temporal analysis) |
classes |
N vector of types or class of each individual (column) in the group by individual matrix (for subsetting) |
which_classes |
vector of class(es)/type(s) to include in the network (subset of classes) |
Calculate the lagged association rate for given timesteps.
Returns a matrix with Log(time) in the first column and the lagged association rate in the second
Damien R. Farine
Whitehead (2008) Analyzing Animal Societies section 5.5.1
data("group_by_individual")
data("times")
data("individuals")
## calculate lagged association rate for great tits
lagged_rates <- LAR(gbi,times,3600, classes=inds$SPECIES, which_classes="GRETI")
## plot the results
plot(lagged_rates, type='l', axes=FALSE, xlab="Time (hours)", ylab="LAR", ylim=c(0,1))
axis(2)
axis(1, at=lagged_rates[,1], labels=c(1:nrow(lagged_rates)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.