Identifies events as periods where of consecutively TRUE values in a boolean vector.
get_consecutive(
vec,
merge_threshold = NA,
leng_threshold = 3,
do_merge = FALSE
)
A vector of boolean values. Consecutive TRUE vakues designate an event.
An integer value specifying the threshold of the gap
length below in units of time steps which
gaps between events are ignored and the two events on either side of the gap
are merged into a single events. Defaults to NA (ignored). Is ignored if
do_merge=FALSE
An integer specifying the minimum length required for creating an event. Defaults to 3.
A logical specifying whether to merge events if the gap between
them is small (smaller than merge_threshold
).
A data frame containing information about the start date and length of each detected event