Learn R Programming

timetools (version 1.1-2)

year: Extract time properties from POSIX* objects

Description

Objects can be POSIXct, POSIXcti, POSIXctp, etc.

Usage

year(x, ...)

month(x, ...)

day(x, of, ..., first.day = 0)

hour(x, of, ...)

minute(x, of, ...)

second(x, of, ...)

unit(x, ...)

unit(object) <- value

duration(x, ...)

Arguments

x
object from which the property is to be extracted (POSIXct, POSIXcti, POSIXctp)
of
used to specify the main period from wich the time propertie is to extract. For instance : day(x, 'week') will differ from day(x, 'year').
...
arguments to or from other methods
object
POSIXctp to which the unit is to be changed
value
a character or a POSIXt.units indicating the new units of object. The conversion will be effective only if it makes sense (hour to second, ok ; year
first.day
used only if representation == 'wday'. Interger indicating the first day of the week. 0 -> sunday (the default), 1 -> monday, 2 -> tuesday, etc.

Details

year, month, day, hour, minute and second are methods defined to extract the adequat information from a time object.

unit unit<- is used to extract or set the unit of a time object (cf POSIXt.units).