powered by
This function calculates the average length of a sequence of elements, where each sequence is split by spaces.
average_seq_length(sequences)
A numeric value representing the average length of the sequences.
A character vector where each element is a sequence of elements separated by spaces.
sequences <- c('hello world', 'hello world hello', 'hello world hello world') average_seq_length(sequences)
Run the code above in your browser using DataLab