Skip to contents

Example events for testing purposes

Usage

exampleEvents(
  signalWidth = 60,
  eventSeparationTime = 60 * signalWidth,
  from = "2015-06-11",
  to = "2015-06-12",
  signalDensity = 0.01,
  ...
)

Arguments

signalWidth

see description in hsEvents

eventSeparationTime

see description of evtSepTime in hsEvents

from

first day as character string in format yyyy-mm-dd

to

last day as character string in format yyyy-mm-dd

signalDensity

fraction of all timestamps in a full sequence of timestamps that are to be selected randomly from the sequence and that are treated as the "signals" contributing to an event. Default: 0.01, i.e. one percent of a full sequence of timestamps are randomly selected, ordered and passed on to hsEvents that groups these "signal" timestamps into events

...

further arguments passed to hsEvents

Examples

events <- exampleEvents()
  
# Calculate event durations manually
dur <- as.integer(events$tEnd) - as.integer(events$tBeg) + hsSigWidth(events)
  
# All durations should be equal to the durations given in column "dur"
all(dur == events$dur) 
#> [1] TRUE
  
# All pauses after event i should be equal to the pauses before event i+1
all(events$pBefore[-1] == events$pAfter[-nrow(events)])
#> [1] TRUE