This function calculates the duration of each event of collective motion in a dataset.
Arguments
- data
A dataframe with an
event
column (added byget_event_ids
), indicating the event ID that each timestep belongs to. Timesteps that are not part of an event should not be included in the data.- step2time
The sampling frequency of the dataframe (how many seconds are between each row of the data).
Author
Marina Papadopoulou m.papadopoulou.rug@gmail.com