Skip to contents

numbering timestamps according to event information

Usage

hsEventNumber(
  tstamps,
  events,
  eventNumbers = seq_len(nrow(events)),
  commaSeparated = FALSE
)

Arguments

tstamps

vector of timestamps

events

event information as returned by hsEvents

eventNumbers

optional vector of event numbers with as many elements as there are rows in tstamps. Default: seq_len(nrow(events))

commaSeparated

if there are timestamps taht belong to more than one event, the default behaviour (commaSeparated = FALSE) of this function is to return a list with each list element being a vector of integer numbers representing the numbers of events to which the corresponding timestamps belong. With commaSeparated = TRUE, the list of event numbers is converted into a vector of character where each element is a text string in which more than one event number are separated by a comma. E.g. c("1", "1,2", "2") would be returned if the first timestamp belongs to event 1, the second to both event 1 and 2, and the third to event 2.