Returns vector of booleans indicating whether the timestamps at corresponding positions in a vector of timestamps lie within a time interval, specified by first and/or last timestamp of the interval.

timestampIn(
  tstamps,
  tsFirst = NULL,
  tsLast = NULL,
  firstIncluded = TRUE,
  lastIncluded = FALSE,
  dbg = FALSE
)

Arguments

tstamps

vector of timestamps, either as character strings in ISO-format (yyyy-mm-dd HH:MM:SS), as Date objects or as POSIXt-objects

tsFirst

first timestamp (firstIncluded == TRUE) or timestamp directly before first timestamp (firstIncluded == FALSE) to be considered

tsLast

last timestamp (lastIncluded == TRUE) or timestamp directly after last timestamp (lastIncluded == FALSE) to be considered

firstIncluded

if TRUE, tsFirst represents the first, otherwise the timestamp direcly before the first timestamp to be considered.

lastIncluded

if TRUE, tsLast represents the last, otherwise the timestamp direcly after the last timestamp to be considered.

dbg

should debug messages be shown?

Examples

tstamps <- sequenceOfTimestamps("2017-11-03", "2017-11-04") table(timestampIn(tstamps, "2017-11-03 12:00:00", "2017-11-03 13:00:00"))
#> #> FALSE TRUE #> 1381 60