Minimum Time Step in Sequence of Timestamps

minTimeStep(tstamps, dbg = FALSE)

Arguments

tstamps

vector of POSIX-type timestamps or any other vector that can be converted to integer

dbg

should debug messages be shown?

Examples

tstamps <- seq(as.POSIXct("2017-11-03"), as.POSIXct("2017-11-04"), 3600) minTimeStep(tstamps)
#> [1] 3600
# No need for timestamps! minTimeStep(c(10, 20, 30, 40, 45, 50, 60))
#> [1] 5
minTimeStep(c(10, 20, 30, 40, 45, 50, 60), dbg = TRUE)
#> timestep: 5 s (min. time diff. found between consecutive timestamps).
#> [1] 5