[Rd] Date + difftime (PR#13369)

ggrothendieck at gmail.com ggrothendieck at gmail.com
Thu Dec 4 05:00:08 CET 2008

Full_Name: G. Grothendieck
Version: 2.8.0
OS: Vista
Submission from: (NULL) (

Get rid of the annoying warning.  This is supposed to be valid according to
?Ops.Date (shown at end):

> today <- Sys.Date()
> tomorrow <- today + 1
> dt <- tomorrow - today
> today + dt
[1] "2008-12-05"
Warning message:
Incompatible methods ("+.Date", "Ops.difftime") for "+" 


Operators on the Date Class
Operators for the "Date" class. 

There is an Ops method and specific methods for + and - for the Date class. 

date + x
date - x
date1 lop date2

date date objects 
date1, date2 date objects or character vectors. (Character vectors are converted
by as.Date.) 
x a numeric vector (in days) or an object of class "difftime". 
lop One of ==, !=, <, <=, > or >=.

More information about the R-devel mailing list