[R-SIG-Finance] [R] NA When Setting Options to See Fractions of Seconds
R. Michael Weylandt
michael.weylandt at gmail.com
Wed Oct 10 22:04:18 CEST 2012
I've moved this to R-SIG-Finance thinking there might be a more
relevant audience.
RMW
On Tue, Oct 9, 2012 at 7:49 PM, Alex Zhang <alex.zhang at ymail.com> wrote:
> Dear all,
>
> I just found a weird behavior of the timeDate related functions Sys.timeDate() and as.timeDate().
> Both of them take place when showing fractions of seconds and I think they might have the same source.
>
> Do you know if it should be considered a bug of Sys.timeDate()? Also, what is a good way to generate timeDate with fractions of seconds from strings? I know I can just get the whole part of seconds and add fractions to it. That is a little bit unnecessarily awkward IMO. Thanks!
>
> - Alex
>
> Below is my whole session:
>
> R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows"
> Platform: i386-pc-mingw32/i386 (32-bit)
>
>> require(timeDate)
>> Sys.timeDate()
> New_York
> [1] [2012-10-09 14:35:21]
>> options("digits.secs"=3)
>> Sys.timeDate()
> New_York
> [1] [NA]
> Warning message
>> Sys.time()
> [1] "2012-10-09 14:43:45.303 EDT"
>> as.timeDate("2012-10-09 14:43:45.303 EDT")
> New_York
> [1] [NA]
> Warning message
>> as.timeDate("2012-10-09 14:43:45.303")
> New_York
> [1] [NA]
> Warning message
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org 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.
More information about the R-SIG-Finance
mailing list