The timetools package use a set of valid time units which are
roughly : year, month, week, day, hour, minute, second.
They can be combined in subtime objects
.
For instance : month of year, minute of day, minute of week, etc.
POSIXt.units(x = NULL, ...) unit(x, ...)
unit(object) <- value
of(x, ...)
a character string representing the needed
units for POSIXt.units
. The object from which
the time unit is to retrieve.
POSIXctp to which the unit is to be changed
a character or a POSIXt.units
indicating the new units of object.
arguments to or from other methods
With no argument, the function return a factor containing the valid time units. With an argument, it returns the units asked for.
Return the time unit of the object. In case 'x' is a
POSIXst
, the unit is the 'left' part of
its unit : if 'x' is a 'minute of day', 'unit' will return
'minute'.
For POSIXst
only, it return the 'right' part
of the unit of 'x' : if 'x' is a 'minute of day', 'of' will return
'day'.