roundSec

Share:

Description

round times to given time interval

Usage

1
roundSec(x, sec = 180)

Arguments

x

vector of POSIXct, times to round

sec

rounding interval, default each 180 seconds, i.e. 3 minutes

Author(s)

Thomas Wutzler

Examples

1
2
3
4
5
6
midnight <- as.POSIXct("2014-12-09 00:00:00")
testTimes <- midnight +60*c(-1.51,-1.5,0,1.49,1.5,1.51,4.49)
testTimes
(rTestTimes <- roundSec(testTimes))
# getDaysMinute(rTestTimes)
roundSec(testTimes, sec=5*60)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.