| floor_time | R Documentation |
Truncates a Date or POSIXct column down to a unit boundary – the basis
for time bucketing. Usable inside mutate() / filter(); resample()
calls it for you.
floor_time(t, unit)
t |
A |
unit |
A bucket size as a string: a count and a unit, e.g. |
The result is returned in the column's own scale (days for Date, seconds
for POSIXct), so it remains a valid instant. The engine does not re-attach
the Date/POSIXct class to a computed column, so a floored column
collects as the underlying numeric epoch; wrap with as.POSIXct(x, origin = "1970-01-01", tz = "UTC") or as.Date(x, origin = "1970-01-01") if you
need the class back.
A numeric (epoch) column.
resample()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.