timestampIn: Timestamps within Time Interval?

Description Usage Arguments Examples

View source: R/filter.R

Description

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.

Usage

1
2
3
4
5
6
7
8
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

1
2
tstamps <- sequenceOfTimestamps("2017-11-03", "2017-11-04")
table(timestampIn(tstamps, "2017-11-03 12:00:00", "2017-11-03 13:00:00"))

KWB-R/kwb.datetime documentation built on July 9, 2021, 10:28 p.m.