tact {heR.Activities}R Documentation

Create, Coerce, or Test a Time-Activity Object

Description

Creates a time-activity object from a series of numeric time breaks and one or more equal-length sets of event flags.

Usage

tact(breaks, events, hhmm = FALSE)
as.tact(x)
is.tact(x)

Arguments

breaks vector of numeric breaks, or a list (see below)
events list of event set vectors (any type) or a single event vector
hhmm logical, interpret `breaks' as HHMM 24-hour clock time
x an object to coerce or test to/for a time-activity object

Details

There should be one more break than there are events, and the times must be strictly increasing. The event flags can either be numeric codes (possibly with names) or character labels.

If `hhmm=TRUE', then the time breaks are interpreted as 24-h clocktime in 'HHMM' character format where HH=hour and MM=minute (eg,14:12); otherwise the breaks are in units of continuous time (e.g., either seconds, minutes, or hours). The HHMM times are assumed to be increasing, and this cannot be checked because, for example, "0012" could occur *after* "1203" on a following day.

If only `breaks' is given, then it is checked for list-hood with two components: 'breaks' and 'events'. If it is not a list, then it is interpreted as a simple vector, and 'events' is assigned unique, increasing integers for each time interval.

The `events' component of the tact object is a list of equal-length vectors (many times just one) containing the sets of event flags.

Value

A logical or a time-activity object consisting of a list containing a numeric vector of breaks as the first component and a list of event sets as the second component.

Author(s)

Neil Klepeis

See Also

mtact, plot.tact, ta.integ, ta.samp, raw2tact


[Package heR.Activities version 0.0.4 Index]