View source: R/events_N_duration.R
| calc_dur_per_event | R Documentation | 
This function calculates the duration of each event of collective motion in a dataset.
calc_dur_per_event(data, step2time)
data | 
 A dataframe with an   | 
step2time | 
 The sampling frequency of the dataframe (how many seconds are between each row of the data).  | 
A dataframe with two columns, event ID and duration in seconds.
Marina Papadopoulou m.papadopoulou.rug@gmail.com
events_dur, get_event_ids
data <- data.frame(
set = c(rep('1', 50), rep('2', 50)),
event = c(rep(NA, 10), rep(1, 40), rep(2, 30), rep(NA, 20))
)
time_per_row <- 1 # seconds
calc_dur_per_event(data, time_per_row)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.