Learn R Programming

rccdates (version 1.0.0)

as.year: Year vectors

Description

Creates or coerces objects of type year.

Usage

as.year(x)
"as.year"(x)
"as.year"(x)
is.year(x)
"-"(a, b)
width.year(x)

Arguments

x
object to be coerced or tested
a, b
years to be added or subtracted

Value

Vector of class year and "AsIs" (see function I).

Details

The year class also inherits methods from the character class but not from numeric. (It does not make any sence to, for example, multiply two years with each other). There are however methods for subtraction and it is also possible to add a integer to a year etcetera.

Examples

Run this code
as.year("2012")
as.year(Sys.Date())
rccmisc::width(c(2012, 2014))

Run the code above in your browser using DataLab