trunc.POSIXt: return the floor, ceiling, or rounded value of date or time to
specified unit.
Description
trunc.POSIXt returns the date truncated to the specified unit.
ceiling.POSIXt returns next ceiling of the date at the unit selected in
units.
floor.POSIXttrunk.POSIXt by another name.
round.POSIXt returns the date or time value rounded to nearest
specified unit selected in digits.
trunc.POSIXt and round.POSIXt have been extended from
the base package functions.
Usage
ceil(x, units,…)
# S3 method for default
ceil(x, units, …)
# S3 method for POSIXt
trunc(x, units = c("secs", "mins", "hours", "days",
"months", "years"), …)
# S3 method for POSIXt
ceil(x, units = c("secs", "mins", "hours", "days",
"months", "years"), …)
# S3 method for POSIXt
round(x, digits = c("secs", "mins", "hours", "days", "months", "years"))
Arguments
x
date to be floored, ceilinged, truncated, or rounded
units
unit to that is is rounded up or down to.
digits
same as units but different name to be compatible
with round generic.
…
further arguments to be passed to or from other methods.