#' Years
#'
#' Extract year from Date/POSIXt object.
#'
#' @param x a vector of dates, of class \code{Date} or \code{POSIXt}.
#'
#' @return Vector of years as integers.
#'
#' @export
years <- function(x)
{
as.integer(format(x, "%Y"))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.