Creates events from vector tseries of timestamps based on time differences between consecutive timestamps in tseries.
hsEvents(tseries, evtSepTime, signalWidth, tUnit = "s", pause = TRUE,
evtSepOp = "gt", dbg = FALSE, check.sorting = FALSE)
vector containing a sorted list of timestamps.
“event separation time” in seconds. Maximal allowed time difference between two consecutive timestamps within the same event.
“signal width” in seconds. Length of time interval that one timestamp is representing, e.g. \(5*60 = 300\) if each timestamp respresents a time interval of five minutes (as e.g. a time series is recorded on a five minute time scale). This parameter is needed to calculate event durations.
time unit of event duration and event pauses
if TRUE, pauses before and after the events are calculated
event separation operator, either "gt" or "ge". If evtSepOp = "gt" (default) events are separated on time differences between two consecutive timestamps that are greater than evtSepTime. If evtSepOp = "ge" events are separated on time differences between two consecutive timestamps that are greater than or equal to evtSepTime.
if TRUE
, debug messages are shown.
if TRUE
, it is checked whether the timestamps
given in tseries
are sorted and the program stops if this is not the
case.
data frame with columns iBeg and iEnd indicating first and last index of the event in the tseries vector, tBeg and tEnd indicating first and last timestamp of the event and dur indicating the event duration in seconds.