read_rttm: read rttm files

Description Usage Arguments Details Value Examples

View source: R/read_rttm.R

Description

read and prettify rttm files

Usage

1
read_rttm(x, from = NULL, to = NULL)

Arguments

x

character, path to rttm file

from, to

numeric, specify subset along the time axis (by default both are NULL, i.e. the entire file is considered)

Details

The function adds an end time column and assigns meaningful column names for the most relevant columns. The actual content of the eighth column (tier) depends on the rttm file. For example, 'yunitator' rttm files have levels CHI, FEM and MAL, while SAD outputs contain speech (or in the case of the full noisemes module other labels like background, noise etc).

If the rttm file is empty (i.e. contains no annotations), the result is a data frame with no rows.

If either from or to are specified, segments that overlap are cut accordingly. For example, if from = 8 and there is a segment that starts at 7.5 and ends 8.7, this segment will be included as starting at 8 (i.e. the from value) and ending at 8.7

Value

a data.frame

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
rttm <- system.file("noisemesSad_synthetic_speech_overlap.rttm",
                    package = "avutils")
read_rttm(rttm)
rttm <- system.file("noisemesFull_synthetic_speech_overlap.rttm",
                    package = "avutils")
read_rttm(rttm)
rttm <- system.file("yunitator_english_synthetic_speech_overlap.rttm",
                    package = "avutils")
read_rttm(rttm)
rttm <- system.file("tocomboSad_synthetic_speech_overlap.rttm",
                     package = "avutils")
read_rttm(rttm)
# time subsetting
read_rttm(rttm, from = 8, to = 11)
# empty result because no annotations before 5 seconds
read_rttm(rttm, to = 5)

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