as.Date.timeDate

Yohan Chalabi chalabi at phys.ethz.ch
Wed Oct 19 10:02:44 CEST 2011


On 18 oct. 2011, at 15:15, Achim Zeileis wrote:

> Yohan:
> 
>> Thanks for the message.
>> 
>> As mentioned in the r-sig-finance, timeDate already exports as.Date.timeDate.
> 
> Maybe we should have been more precise in our request: It would be great if "timeDate" could fully export "as.Date.timeDate" and not only as an S3 method.
> 
>> The problem is really coming from zoo which overwrites the base function as.Date and do not import as.Date methods from other packages.
> 
> Yes, true. However, to make the dependency path not longer than it already is, it would be nice if you could fully export your method. Then it is found by both generics - the one in base R and the one in zoo.
> 
> If you're wondering why zoo masks as.Date(). After zoo had long provided an as.Date.numeric, base R decided to break that by adding their own that requires an additional "origin" argument without default. For several year's we worked around this by simply replacing base:::as.Date.numeric in the base NAMESPACE when loading zoo. Then, R-core decided to disallow this workaround and now we have to ship our own generic to assure correct dispatch.

Hi Achim,

Yes, I remember the as.Date.numeric issue. We had to change many functions in our packages because of that.

timeDate will then fully export as.Date.timeDate in its next release.

Regards,
Yohan


> 
> Thanks & best regards,
> Z
> 
>> Regards,
>> Yohan
>> 
>> On 14 oct. 2011, at 20:37, Gabor Grothendieck wrote:
>> 
>>> Changes in R have necessitated a change in zoo which results in any
>>> as.Date method in the timeDate package (or any other package that does
>>> not export their as.Date methods) not to be dispatched.
>>> 
>>> This can be fixed by either exporting any as.Date method in the
>>> NAMESPACE file (or by importing zoo in the NAMESPACE file).
>>> 
>>> See:
>>> 
>>> https://stat.ethz.ch/pipermail/r-sig-finance/2011q4/008751.html
>>> 
>>> --
>>> Statistics & Software Consulting
>>> GKX Group, GKX Associates Inc.
>>> tel: 1-877-GKX-GROUP
>>> email: ggrothendieck at gmail.com
>>> 
>>> _______________________________________________
>>> Rmetrics-core mailing list
>>> Rmetrics-core at r-project.org
>>> https://stat.ethz.ch/mailman/listinfo/rmetrics-core
>>> 
>> 
>> _______________________________________________
>> Rmetrics-core mailing list
>> Rmetrics-core at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/rmetrics-core
>> 
> 
> _______________________________________________
> Rmetrics-core mailing list
> Rmetrics-core at r-project.org
> https://stat.ethz.ch/mailman/listinfo/rmetrics-core
> 



More information about the Rmetrics-core mailing list