Learn R Programming

emuR (version 2.5.0)

track.gradinfo: Calculate gradient summary information for trackdata

Description

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

Usage

track.gradinfo(trackdata)

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]).

Arguments

trackdata

An Emu trackdata object as returned by get_trackdata

Author

Steve Cassidy

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).

See Also

get_trackdata, dapply

Examples

Run this code

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]

Run the code above in your browser using DataLab