Ola Lindqvist
2007-Aug-20 13:26 UTC
[R] library(fCalendar) timeDate("12.03.2005",format="%d.%m.%Y")
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
Duncan Murdoch
2007-Aug-20 13:41 UTC
[R] library(fCalendar) timeDate("12.03.2005", format="%d.%m.%Y")
On 8/20/2007 9:26 AM, 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 >You should address questions about contributed packages to the maintainer of the package, in this case Diethelm Wuertz and Rmetrics Core Team <wuertz at itp.phys.ethz.ch>. Duncan Murdoch
Martin Becker
2007-Aug-20 14:40 UTC
[R] library(fCalendar) timeDate("12.03.2005", format="%d.%m.%Y")
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. >