Learn R Programming

AnimalSequences (version 0.2.0)

temporal_overlap: Temporal Overlap

Description

This function calculates the temporal overlap of elements in sequences. It determines how much each element overlaps with other elements in the same sequence.

Usage

temporal_overlap(sequences_long)

Value

A data frame summarizing the mean overlap elements and mean overlap proportion for each element.

Arguments

sequences_long

A data frame containing sequences with columns: sequence_nr, element, start_time, and end_time.

Examples

Run this code
sequences_long <- data.frame(
  sequence_nr = c(1, 1, 1, 2, 2),
  element = c("A", "B", "C", "A", "B"),
  start_time = c(0, 5, 10, 0, 5),
  end_time = c(5, 10, 15, 5, 10)
)
result <- temporal_overlap(sequences_long)
print(result)

Run the code above in your browser using DataLab