On Thu, 11 Feb 2010, Jonathan wrote:

Anybody have an idea why I would get a non-integer value for the
number of days here?

difftime('2004-08-05','2001-01-03',units='days')
Time difference of 1309.958 days

Because it's not a whole number of 24-hour periods, due to daylight saving 
time: 0.958 is 23/24.


Would you just round off?


Yes, or use as.Date() if you only want to consider whole days

R> as.Date('2004-08-05')-as.Date('2001-01-03')
Time difference of 1310 days

       -thomas

Thomas Lumley                   Assoc. Professor, Biostatistics
tlum...@u.washington.edu        University of Washington, Seattle

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to