track.gradinfo: Calculate gradient summary information for trackdata

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/track.gradinfo.R

Description

Calculates a number of summary measures for a trackdata object: duration, start and end data points, delta values and slope.

Usage

1

Arguments

trackdata

An Emu trackdata object as returned by get_trackdata

Details

track.gradinfo calculates a number of summary measure for the segments within a trackdata object. These are useful for data such as kinematic measures where segments might correspond to articulatory movements etc.

Measures returned are: duration, start and end data values (ie. the first and last rows of data for each segment), delta (the difference between the first and last rows of data) and slope (delta divided by the duration).

Value

A data frame with one row per segment and columns:

duration

Segment

startN

The starting value for each segment (start1 is the starting value for the first column)

endN

The ending value for each segment

deltaN

The delta value for each segment

slopeN

The slope value for each segment

Since the result is a data frame, the columns can be referred to by name (result$duration) or as matrix columns (result[,1]).

Author(s)

Steve Cassidy

See Also

get_trackdata, dapply

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
data(vowlax)
segs = vowlax
## fm has 4 columns
data.fm <-vowlax.fdat
## F0 has one
data.F0 <- vowlax.fund
## info.fm will have duration, 4xstart, 4xend, 4xdelta, 4xslope
info.fm <- track.gradinfo(data.fm)
## this should be true
ncol(info.fm) == 1+4+4+4+4

## info.F0 will have one of each
info.F0 <- track.gradinfo(data.F0)
## this should be true
ncol(info.F0) == 1+1+1+1+1

## plot the durations vs delta of the first formant
plot(info.F0$duration, info.fm$delta1, type="n", xlab="Duration", ylab="Delta")
text(info.fm$duration, info.fm$delta1, labels=label(segs))

## extract just the delta values from the formant info
## You need to eyeball the data to work out which columns to select
delta.fm <- info.fm[,10:13]

emuR documentation built on June 11, 2021, 5:10 p.m.