get_associations_points_tw {asnipe} | R Documentation |
A time window approach to calculate group co-memberships.
get_associations_points_tw(point_data, time_window = 180, which_days = NULL, which_locations = NULL)
point_data |
dataframe of four columns: |
time_window |
window around each individual for calculating associations |
which_days |
subset of |
which_locations |
subset of |
Calculates an ego-centric approach to group membership (see warning). For each detection, a group is created with and all associates within the time window at the same location are included.
Input data must be of the following form: Date is an integer for day (usually starting at 1 on the first day). Time are the number of seconds elapsed from the start (continuous across all dates). ID is a unique character string for each individual. Location is a unique character string for each location.
Returns a list with three objects: 1. group by individual matrix (K rows by N columns) 2. an array of times for each group 3. an array of locations for each group
This method biases associations of dyads occuring in large groups. One way to circumvent this is by including only groups centered around the focal individual when calculating associations. However, none of the functions in this package are implement this way.
Damien R. Farine
data("identified_individuals") ## calculate group_by_individual for first day at one location group_by_individual <- get_associations_points_tw(identified_individuals, time_window=180, which_days=1,which_locations="1B") ## split the resulting list times <- group_by_individual[[2]] locations <- group_by_individual[[3]] group_by_individual <- group_by_individual[[1]]