Learn R Programming

tidychangepoint (version 1.0.0)

as_year: Convert a date into a year

Description

Convert a date into a year

Usage

as_year(x)

Value

A character vector representing the years of the input

Arguments

x

an object coercible into a base::Date. See base::as.Date().

Examples

Run this code
# Retrieve only the year
as_year("1988-01-01")

Run the code above in your browser using DataLab