Ops.Date {base}R Documentation

Operators on the Date Class

Description

Operators for the "Date" class.

There is a method for the Ops group generic handing the comparison operators and specific methods for + and -.

Usage

date + x
x + date
date - x
date1 lop date2

Arguments

date date objects
date1, date2 date objects. One can be a character vector which will be converted by as.Date.
x a numeric vector (in days) or an object of class "difftime", rounded to the nearest whole day.
lop One of ==, !=, <, <=, > or >=.

Details

x does not need to be integer if specified as a numeric vector, but see the comments about fractional days in the help for Dates.

Examples

(z <- Sys.Date())
z + 10
z < c("2009-06-01", "2010-01-01", "2015-01-01")

[Package base version 2.10.1 Index]