[R] library(fCalendar) timeDate("12.03.2005", format="%d.%m.%Y")
martin.becker at mx.uni-saarland.de
Mon Aug 20 16:40:04 CEST 2007
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
< 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:
PS: Maybe r-sig-finance is more appropriate for questions concerning
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
> R-help at stat.math.ethz.ch mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help