find_frequent_interval: Find the most frequent interval of values

View source: R/time.R

find_frequent_intervalR Documentation

Find the most frequent interval of values

Description

When we have trials of varying lengths, it can be helpful to find the interval of time shared by most of the trials.

Usage

find_frequent_interval(xs, min_freq = 0.8)

Arguments

xs

some set of values (times)

min_freq

the minimum frequency of times to keep

Value

a list with the minimum and maximum values that have a frequency of at least 80%.

Examples

times <- c(
  -5:10, -10:10, -8:10, -8:10, -8:11, -8:13, -8:4,
  -5:12, -10:9
)
find_frequent_interval(times)

tjmahr/littlelisteners documentation built on July 31, 2024, 6:02 a.m.