round_time

0th

Percentile

A generic function for rounding date and time values

A generic function for rounding date and time values

Usage
round_time(x, n, tz)
Arguments
x

A vector of class POSIX or Date.

n

Unit to round to. Defaults to mins. Numeric values treated as seconds. Otherwise this should be one of "mins", "hours", "days", "weeks", "months", "years" (plural optional).

tz

Time zone to be used, defaults to "UTC" (Twitter default)

Value

If POSIXct then POSIX. If date then Date.

Aliases
  • round_time
Examples
# NOT RUN {
## class posixct
round_time(Sys.time(), "12 hours")

## class date
unique(round_time(seq(Sys.Date(), Sys.Date() + 100, "1 day"), "weeks"))
# }
Documentation reproduced from package rtweet, version 0.6.8, License: MIT + file LICENSE

Community examples

Looks like there are no examples yet.