R/extract_movement_functions.R
extract_durations.RdExtracts the overall duration during which an inner_col in a movement or
eye tracker tibble took its unique values. This generalises the notion of a
frequency table to account for potentially uneven sampling and can be handy
for example to extract fixation durations from an eye tracker tibble. This
function works differently from other extract_... function in that it
returns a tibble, not a scalar value (and NULL rather than NA_real_ in
case of invalid input)
extract_durations(df, inner_col, min_time = 0, max_time = Inf)The table of durations for each value in the inner_col in descending order
Each row in which a value is observed adds to the duration of that value half the time interval to the previous timestamp and half the time interval to the next timestamp.