R/Date.R

Defines functions years years.Date

Documented in years years.Date

##
##  Functions to complete Dates
##
#' Get the year of a Date object
#' 
#' Works like 'months', 'weekdays', etc. for years.
#' 
#' @param x a Date object
#' @return the year as an integer
#' @export
years <- function(x,...) UseMethod("years")
#' @describeIn years method for Date objects
#' @export
years.Date <- function(x,...) as.numeric(format(x,"%Y"))
gmonette/HG documentation built on May 17, 2019, 7:25 a.m.