units
Units for Time Intervals

Description

Units for time intervals.

Usage

units(x)
## S3 method for class 'difftime':
units(x)

units(x) <- value ## S3 method for class 'difftime': units(x) <- value

Arguments

x a difftime object.
value a character string specifying the time unit, such as "secs", "mins", "hours", "days", and "weeks".
Value
units, units.difftime returns the units attribute of x.
units<-, units<-.difftime returns a difftime object converted from x with value used as the time unit.
See Also
difftime
Examples
(dt <- as.difftime("01:00:00"))
units(dt)

units(dt) <- "secs"; dt units(dt)

Package base version 6.1.1-7
Package Index