Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upApparently anytime() not handling July in "%d-%b-%Y" format #33
Comments
|
Works here: R> dtchar <- c( "30-Jun-2014 23:30:00", "30-Jun-2014 23:45:00", "01-Jul-2014 00:00:00",
+ "01-Jul-2014 00:15:00", "01-Jul-2014 00:30:00")
R> dtchar
[1] "30-Jun-2014 23:30:00" "30-Jun-2014 23:45:00" "01-Jul-2014 00:00:00"
[4] "01-Jul-2014 00:15:00" "01-Jul-2014 00:30:00"
R> anytime(dtchar)
[1] "2014-06-30 23:30:00 CDT" "2014-06-30 23:45:00 CDT" "2014-07-01 00:00:00 CDT"
[4] "2014-07-01 00:15:00 CDT" "2014-07-01 00:30:00 CDT"
R> Do you have a locale set or something else that would do that? |
|
Ok, glad to report that the issue seems to be with Rstudio IDE not the package. From R command line it behaves correctly but within Rstudio it gives NA. |
|
What country / language are you in? Did you override anything? |
|
I am on Eastern time zone. USA. My report was based on a Windos 7 (64-bit machine). Obviously ,this seems to be specific to my machine because it works on yours. |
|
Now that would be puzzling. I am on Central time, and I will try Windows tomorrow in the virtual machine I have at work. Here, under Linux, it works in RStudio console and terminal as you;d expect. |
|
Ok. Now its confirmed that it's specific to my machine. Worked in another windows. Thanks |
|
Hi there again,
So the puzzling thing here is that the first time you execute the command it works, the next time it doesn't (returns NA). Weird! After restarting R, the same thing happens; first time the right output, next time NA Also NA in the following
So the issue itself is not big because I've now used anytime() this way in my code. Nonetheless, its seems to be reproducible(at least on the windows machines I have tried so far(3 of them)) Here is the system info of the machine where wrote this document
Now, on the previous versions, 32 bit R-3.3.2, and linux (167.04) it's working fine. |
|
Weird. I don't have access to Windows right now and will have to check next week. We fixed something that may be related between anytime 0.1.0 and anytime 0.1.1 -- so just to check, you are on the new version, correct? |
|
Yes. that is correct
…On Sat, Dec 3, 2016 at 12:53 PM Dirk Eddelbuettel ***@***.***> wrote:
Weird. I don't have access to Windows right now and will have to check
next week.
We fixed something that may be related between anytime 0.1.0 and anytime
0.1.1 -- so just to check, you are on the new version, correct?
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#33 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AXJwRCk37-IismP0cbJa3DW8sBmLOA3Qks5rEaypgaJpZM4LAg-7>
.
|
|
@bobjansen In case you're around, can you try on your Windows box? Apparently repeated calling of |
|
Seems to be real. A friend of mine got the same return values on his computer |
|
You guys would need to to debug this. Run |
|
@eddelbuettel I should be able to take a close look tomorrow (So in the next 16 hours). |
|
I can confirm via R Hub (and the excellent rhub package) that this fails as claimed on 64-bit windows. Weird.
File is simple: library(anytime)
dtchar <- c("01-Jul-2015 00:15:00", "01-Jul-2015 00:30:00")
anytime(dtchar)
anytime(dtchar)
stopifnot(sum(!is.na(anytime(dtchar))) == 2)
stopifnot(sum(!is.na(anytime(dtchar))) == 2) |
|
Seems to be related to the string splitter:
This is just wrong: |
|
It's fixed -- using Boost to split strings works. Got that in earlier but had to leave before the test via rhub completed. See this commit for details. PR to follow tomorrow. |
|
I can at least confirm that with that commit it works on Windows 10 (build 14965) works in both RStudio as in standard R. rhub also returns success on my runit branch: https://builder.r-hub.io/status/anytime_0.1.1.1.tar.gz-33f59686733542e7ab06023d8ae291a5 |
|
Thanks. I am glad I found the Boost String Algorithms and will take a peek getting maybe another function converted. We may get more robust code, yet still get by without a new dependency on either C++11 (for regexp) or a new library. |
Here is an an interesting issue I had with anytime()
consider this
Here is what anytime () gave to me
Not sure if this a but but it seems to me that in this format ("%d-%b-%Y %H:%M:%S"), anytime () is returning NA for the month of July
Testing with all the twelve months shows this
while the base as.POSIXct() handles it correctly