[R] library(fCalendar) timeDate("12.03.2005", format="%d.%m.%Y")
Martin Maechler
maechler at stat.math.ethz.ch
Tue Aug 21 17:02:42 CEST 2007
>>>>> "OL" == Ola Lindqvist <ola.lindqvist at nr.no>
>>>>> on Tue, 21 Aug 2007 14:32:19 +0200 writes:
OL> Thanks!
OL> Seems to work fine now!
Well, for your example.
But sorry to say, the patch breaks other cases.
I'm investigating further
(and will hopefully contribute to a new CRAN release of fCalendar
once Diethelm Wuertz is back from wherever; I've already made
more changes)
Martin Maechler,
ETH Zurich [but different department than D.Wuertz]
OL> Martin Becker wrote:
>> Dear Ola,
>>
>> I think you spotted a small bug in *package* fCalendar.
>> Explicit specification should prevent "autodetection" of the date
>> format, which is not the case for fCalendar v251.70, instead
>> autodetection is done at least once (twice, if actually appropriate).
>> With the following patch, things should work ok:
>>
>> diff --recursive fCalendar.orig/R/3A-TimeDateClass.R
>> fCalendar/R/3A-TimeDateClass.R
>> 433c433
>> < charvec = format(strptime(charvec, .whichFormat(charvec)),
>> isoFormat)
>> ---
>> > charvec = format(strptime(charvec, format), isoFormat)
>>
>> You did not provide the output of sessionInfo() (which you are asked
>> for in the posting guide). If you are using Windows and don't know how
>> to apply the patch, you can download a patched binary version here:
>> http://www.saar-gate.net/download/fCalendar_251.70.zip
>>
>> Regards,
>>
>> Martin
>>
>> PS: Maybe r-sig-finance is more appropriate for questions concerning
>> Rmetrics.
>>
>>
>> Ola Lindqvist wrote:
>>> Dear R users,
>>> I have problem with the library fCalendar.
>>>
>>> I am not using the US standard format notations. It seems like it is
>>> not possible to have different format than the US standards.
>>> Anyone how knows a way to go around this problem?
>>>
>>> Here is the code I enter:
>>> myDate = "12.03.2005"
>>> timeDate(myDate, format = "%d.%m.%Y")
>>>
>>> And I get following error message:
>>> Error in if (sum(lt$sec + lt$min + lt$hour) == 0) isoFormat =
>>> "%Y-%m-%d" :
>>> missing value where TRUE/FALSE needed
>>>
>>> Thanks,
>>> Ola
>>>
>>> ______________________________________________
>>> 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
>>> and provide commented, minimal, self-contained, reproducible code.
>>>
>>
OL> ______________________________________________
OL> R-help at stat.math.ethz.ch mailing list
OL> https://stat.ethz.ch/mailman/listinfo/r-help
OL> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
OL> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list