Learn R Programming

emuR (version 2.5.0)

make.seglist: Make an Emu segment list from the various components

Description

This is the appropriate way to make an Emu segment list and ensure that it has all of the required components.

Usage

make.seglist(labels, start, end, utts, query, type, database)

Value

An Emu segment list.

Arguments

labels

A character vector of labels for each segment

start

A vector of start times

end

A vector of end times

utts

A character vector of utterance names

query

A query string

type

segment or event

database

The database name associated with the segment list

Author

Steve Cassidy

Details

An Emu segment list is the result of a query to a speech database (see query) and has one row per matching segment or event from the query. Each row lists the label, start and end times (in milliseconds) and utterance name for the segment. This information is used by get_trackdata and other functions to extract data corresponding to these segments.

In order to ensure the proper format for segment lists and to ensure against future changes to the format, make.seglist should be used whenever you wish to create a segment list. Another function, modify.seglist can be used to change some part of an existing segment list. The functions label.emusegs, start.emusegs, end.emusegs and utt.emusegs can be used to access the different columns of the segment list.

See Also

modify.seglist, label.emusegs

Examples

Run this code


   l <- c("A", "B", "C")
   s <- 1:3
   e <- 2:4
   u <- c("u1", "u1", "u1")
   segs <- make.seglist(l, s, e, u, "Fake Query", "segment", "fake")
   segs
   ## summary gives an overview of the data in the segment list
   summary(segs)
   

   # The following should be TRUE
   label(segs) == l
   dur(segs) == s
   end(segs) == e
   utt(segs) == u
   emusegs.database(segs) == "fake"
   emusegs.type(segs) == "segment"
   emusegs.query(segs) == "Fake Query"

   # segment durations should all be 1
   dur(segs) == c(1,1,1)


Run the code above in your browser using DataLab