Description Usage Arguments Details Value Examples
View source: R/segment_annotations.R
assign each annotation to regular (e.g. one minute) segments
1 | segment_annotations(xdata, segment_dur, timecols = c("start", "end"))
|
xdata |
data.frame, the data object with annotations (e.g. import from ELAN or .rttm file) |
segment_dur |
numeric, the time interval in the relevant unit (no default, see details) |
timecols |
character, the column names for start and end of the annotations (default is |
note that annotations that cross over a given cut point for a segment will be split into two (or more if an annotation is much longer than the segment duration)
a data.frame with a new column cat
that indicates which time interval a given annotation belongs to
1 2 3 4 5 6 7 8 9 10 11 12 13 | annos <- LETTERS[1:5]
start <- c(14, 17, 45, 65, 70)
end <- c(25, 22, 60, 80, 73)
dur <- end - start
xdata <- data.frame(start, end, dur, annos)
xdata
segment_annotations(xdata, segment_dur = 10, timecols = c("start", "end"))
# from an ELAN file:
eaf <- system.file("synthetic_speech.eaf", package = "avutils")
elanfile <- read_elan(eaf)
segment_annotations(elanfile, segment_dur = 0.5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.