year

0th

Percentile

Get/set years component of a date-time.

Get/set years component of a date-time.

Keywords
manip, methods, utilities, chron
Usage
year(x)
Arguments
x
a date-time object
Details

Date-time must be a POSIXct, POSIXlt, Date, chron, yearmon, yearqtr, zoo, zooreg, timeDate, xts, its, ti, jul, timeSeries, and fts objects.

year does not yet support years before 0 C.E.

Value

  • the years element of x as a decimal number

Aliases
  • year
  • year.default
  • year.zoo
  • year.its
  • year.ti
  • year.timeseries
  • year.fts
  • year.irts
  • year<-
  • year<-
  • default
  • year<-.Date
  • year<-.chron
  • year<-.zoo
  • year<-.its
  • year<-.ti
  • year<-.timeDate
  • year<-.jul
  • year<-.timeSeries
  • year<-.fts
  • year<-.irts
  • year<-.yearmon
  • year<-.yearqtr
Examples
x <- now()
year(x) 
year(x) <- 2001  
year(x) > 1995
Documentation reproduced from package lubridate, version 0.1, License: GPL

Community examples

Looks like there are no examples yet.