ceiling.chron {Hmisc}R Documentation

return the minimum or maxium value in a date or time.

Description

ceiling.chron returns maximum value that is 1 less then the next value on the unit selected in units. floor.chron returns the value that is equal to the first time unit selected in units.

Usage

ceiling.chron(x, units = c("minutes", "hours", "days", "months", "years"))
floor.chron(x, units = c("minutes", "hours", "days", "months", "years"))

Arguments

x date to be floored or ceilinged
units unit to that is is rounded up or down to.

Value

An object of class chron.

Author(s)

Charles Dupont

See Also

dates times

Examples

library(chron)
ceiling.chron(dates('7/13/1832'), units='months')  # '7/31/1832'
floor.chron(dates('7/13/1832'), units='years')     # '1/1/1832'

[Package Hmisc version 3.1-2 Index]