utcdate and anydate don't seem to play well with factors (OSX) #44

Closed
mcheema opened this Issue Jan 27, 2017 · 1 comment

Projects

None yet

2 participants

@mcheema
mcheema commented Jan 27, 2017

I am running R on OSX within emacs or from terminal and run into problems like below:

as.factor(20160101 + 0:2)
### [1] 20160101 20160102 20160103
### Levels: 20160101 20160102 20160103
anytime(as.factor(20160101 + 0:2))
### [1] "2015-12-31 23:00:00 GMT" "2016-01-01 23:00:00 GMT"
### [3] "2016-01-02 23:00:00 GMT"
utctime(as.factor(20160101 + 0:2))
### [1] "2016-01-01 GMT" "2016-01-02 GMT" "2016-01-03 GMT"
utcdate(as.factor(20160101 + 0:2))
### [1] "1400-01-01" "1400-02-01" "1400-03-01"
anydate(as.factor(20160101 + 0:2))
[1] "1400-01-01" "1400-02-01" "1400-03-01"
@eddelbuettel
Owner

Good catch. I do a filtering step for anytime() at the R side and failed to insert it for anydate.

Will fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment