[R] Problems with date-format (R 2.1.1 + chron)

Gabor Grothendieck ggrothendieck at gmail.com
Wed Jul 20 03:49:30 CEST 2005


I think its likely that you are using different versions of chron.
I noticed that version "2.2-33" of chron had the statement:

   tms <- dts - trunc(dts)

but version "2.2-35" seems to have replaced it with:

  tms <- dts - floor(dts)

and that seems to be causing the problem.

As a workaround:

    floor.Date <- floor.trunc
    days(as.Date("21-07-2005", "%d-%m-%y"))


On 7/19/05, Carsten Steinhoff <carsten.steinhoff at stud.uni-goettingen.de> wrote:
> Hello,
> 
> today I've updated on the newest R-Version. But sadly a function I needed
> didnt want to work:
> The input is e.g.
> 
> days(as.Date("21-07-2005","%d-%m-%y"))
> 
> the error is: Fehler in Math.Date(dts): floor nicht definiert für Date
> Objekte
> (Error in Math.Date(dts): floor not defined for date objects)
> 
> Same for year. Only months gives me the correct output.
> In Version 2.01 it worked very well, with the same chron library.
> Whats wrong ?
> 
> Carsten
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>




More information about the R-help mailing list