new_interval() creates an interval object with the specified values.

new_interval(...)

Arguments

...

A list of time units to be included in the interval and their amounts. "year", "quarter", "month", "week", "day", "hour", "minute", "second", "millisecond", "microsecond", "nanosecond", "unit" are supported.

Value

an "interval" class

Examples

new_interval(hour = 1, minute = 30)
#> Warning: 'new_interval' is deprecated; use 'interval' instead. Deprecated in version '1.5.0'.
#> Error in interval(...): unused arguments (hour = 1, minute = 30)
new_interval(NULL) # irregular interval
#> Warning: 'new_interval' is deprecated; use 'interval' instead. Deprecated in version '1.5.0'.
#> Error in as.POSIXct.default(x, tz = tz): do not know how to convert 'x' to class “POSIXct”
new_interval() # unknown interval
#> Warning: 'new_interval' is deprecated; use 'interval' instead. Deprecated in version '1.5.0'.
#> Error in tz(start): argument "start" is missing, with no default