powered by
This function calculates summary statistics for the durations of sequences, where the duration is defined as the difference between `end_time` and `start_time`. If `duration` is provided, it will be used directly.
sequence_duration_summary(sequences, start_time, end_time, duration = NULL)
A data frame with the following columns:
The mean duration of the sequences.
The standard deviation of the sequence durations.
The median duration of the sequences.
The minimum duration of the sequences.
The maximum duration of the sequences.
A character vector where each element is a sequence of elements separated by spaces.
A numeric vector representing the start times of the sequences.
A numeric vector representing the end times of the sequences.
(Optional) A numeric vector representing the durations of the sequences. If `NULL`, it will be calculated as `end_time - start_time`.
sequences <- c('hello world', 'hello world hello', 'hello world hello world') start_time <- c(1, 2, 3) end_time <- c(2, 4, 7) sequence_duration_summary(sequences, start_time, end_time)
Run the code above in your browser using DataLab