View source: R/sequence_duration_summary.R
| sequence_duration_summary | R Documentation | 
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)
| sequences | A character vector where each element is a sequence of elements separated by spaces. | 
| start_time | A numeric vector representing the start times of the sequences. | 
| end_time | A numeric vector representing the end times of the sequences. | 
| duration | (Optional) A numeric vector representing the durations of the sequences. If 'NULL', it will be calculated as 'end_time - start_time'. | 
A data frame with the following columns:
| mean_seq_duration | The mean duration of the sequences. | 
| sd_seq_duration | The standard deviation of the sequence durations. | 
| median_seq_duration | The median duration of the sequences. | 
| min_seq_duration | The minimum duration of the sequences. | 
| max_seq_duration | The maximum duration of the sequences. | 
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.