[R] difftime / RBloomberg

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Mar 22 12:58:22 CET 2007


On Thu, 22 Mar 2007, Schiller Judith 1541 EB wrote:

> hi,
>
> I've troubles with some difftime objects. e.g.
>
> ISOdate(2001, 4, 26) - ISOdate(2001, 2, 26) - 2
>
> works, telling me "Time difference of 57 days". But when I'd like to add
> days, such as
>
> ISOdate(2001, 4, 26) - ISOdate(2001, 2, 26) + 2
>
> the function gives me an error.

The error being?  (It does not give me an error.)

>  Function "as.COMDate.chron" of the
> Rbloomberg package doesn't work for that reason.
> I'm running R on a Windows machine, R version 2.4.1.

I cross-checked on that system.

It is quite possible the error is due to some other package that you are 
using: that's why we ask for the result of sessionInfo().

I would expect

(ISOdate(2001, 4, 26) - ISOdate(2001, 2, 26)) - (-2)

to be a workaround, BTW.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list