powered by
This function summarizes the number of events and their total duration in the dataset.
events_summary(data, step2time)
A dataframe with 3 columns: set, ev_count (number of events), and dur (duration of events in seconds).
set
ev_count
dur
A dataframe with a keep column (representing which rows are defined as events of collective motion) and a set column.
keep
The sampling frequency of the dataframe (how many seconds are between each row of the data).
Marina Papadopoulou m.papadopoulou.rug@gmail.com
events_dur, events_n
events_dur
events_n
data <- data.frame( set = c(rep('1', 50), rep('2', 50)), keep = c(rep(FALSE, 10), rep(TRUE, 70), rep(FALSE, 20)) ) time_per_row <- 1 # seconds events_summary(data, time_per_row)
Run the code above in your browser using DataLab