subset_time: select subset of elan or rttm annotations

Description Usage Arguments Details Value Examples

View source: R/subset_time.R

Description

select subset of elan or rttm annotations

Usage

1
2
subset_time(x, from = NULL, to = NULL, include_incomplete = TRUE,
  shift_times = FALSE)

Arguments

x

a data.frame (result from read_elan or read_rttm)

from

numeric, include annotations from this point forward (by default NULL, i.e. take everything from the first line of the data)

to

numeric, include annotations up to that point (by default NULL, i.e. take up to the last line)

include_incomplete

logical, should annotations that cross from = and/or to = be kept (by default TRUE)

shift_times

logical, not implemented (yet)

Details

If you keep annotations that cross the from and/or to boundaries, the durations of those annotations will be updated.

Value

a data.frame

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
rttm <- system.file("yunitator_old_synthetic_speech_overlap.rttm", package = "avutils")
x <- read_rttm(rttm)
# leave unchanged
subset_time(x)
# up to 26
subset_time(x, to = 26)
# remove incomplete anno (25.6 - 26.3)
subset_time(x, to = 26, include_incomplete = FALSE)

elan <- system.file("synthetic_speech_overlap.eaf", package = "avutils")
x <- read_elan(elan)
# leave unchanged
subset_time(x)
# up to 29
subset_time(x, to = 29)
# remove incomplete anno (28.3 - 30.5)
subset_time(x, to = 29, include_incomplete = FALSE)

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