collapse_tiers: collapse overlapping annotations

Description Usage Arguments Details Value Examples

View source: R/collapse_tiers.R

Description

from overlapping tiers

Usage

1
2
collapse_tiers(xdata, timecols = c("start", "end"),
  ignore_tiers = NULL, ignore_annos = NULL)

Arguments

xdata

data.frame, the data object with annotations (e.g. import from ELAN or .rttm file)

timecols

character, the column names for start and end of the annotations (default is c("start", "end")).

ignore_tiers

character, at least of length 2, where the first item is the column name for the tiers, and subsequently lists all tier names that should be ignored

ignore_annos

character, at least of length 2, where the first item is the column name for the annotations, and subsequently lists all annotation values that should be ignored

Details

this is a fairly inefficient function (=slow)

Also, in the process annotations are re-ordered such that start time increases.

Value

a matrix with two columns for the start and end times of (collapsed) annotations

Examples

1
2
3
4
5
6
7
8
annos <- LETTERS[1:5]
start <- c(14, 17, 45, 65, 70)
end <- c(25, 23, 60, 80, 82)
duration <- end - start
xdata <- data.frame(start, end, duration, annos)
# second anno is merged into first because it's completely comprised in the first
# last two annos are 'combined' into one
collapse_tiers(xdata = xdata, timecols = c("start", "end"))

gobbios/avutils documentation built on Feb. 19, 2020, 9:44 a.m.