Skip to content

Is x a length of time?

Usage

is.timespan(x)

Arguments

x

an R object

Value

TRUE if x is a period, interval, duration, or difftime object, FALSE otherwise.

Examples

is.timespan(as.Date("2009-08-03")) # FALSE
#> [1] FALSE
is.timespan(duration(second = 1)) # TRUE
#> [1] TRUE