RDocumentation
Moon
Learn R
Search all packages and functions
statar (version 0.1.1)
floor_date: floor_date Round date-times down.
Description
floor_date takes a date-time object and rounds it down to the nearest integer value of the specified time unit. Users can specify whether to round down to the nearest second, minute, hour, day, week, month, quarter or year.
Usage
floor_date(x, unit = c("second", "minute", "hour", "day", "week", "month", "quarter", "year"))
Arguments
x
a vector of date-time objects
unit
a character string specifying the time unit to be rounded to. Should be one of "second","minute","hour","day", "week", "month", or "year."
Value
x with the appropriate units floored