Learn R Programming

emuR (version 2.4.0)

as.trackdata: Create an Emu trackdata object

Description

Create an Emu trackdata object from a raw data matrix.

Usage

as.trackdata(data, index, ftime, trackname = "")

Value

The components are bound into a trackdata object.

Arguments

data

A two dimensional matrix of numerical data.

index

Segment index, one row per segment, two columns give the start and end rows in the data matrix for each segment.

ftime

A two column matrix with one row per segment, gives the start and end times in milliseconds for each segment.

trackname

The name of the track.

Details

Emu trackdata objects contain possibly multi-column numerical data corresponding to a set of segments from a database. Data for each segment takes up a number of rows in the main data matrix, the start and end rows are stored in the index component. The ftime component contains the start and end times of the segment data.

Trackdata objects are returned by the get_trackdata function.

See Also

get_trackdata dplot

Examples

Run this code


# make a trackdata object of two data segments
data1 <- matrix( 1:10, ncol=2 )
data2 <- matrix( 11:20, ncol=2 )

nd1 <- nrow(data1)
nd2 <- nrow(data2)
index <- rbind( c( 1, nd1 ), c(nd1+1,nd1+nd2) )

times <- rbind( c( 100.0, 110.0 ), c( 200.0, 210.0 ) )

tdata <- as.trackdata( rbind( data1, data2 ), index, times, trackname="fake")

# describe the data
summary(tdata)
# get the data for the first segment
tdata[1]
# and the second
tdata[2]


Run the code above in your browser using DataLab