Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parse_date_time error #322

Closed
leoluyi opened this issue May 11, 2015 · 6 comments
Closed

parse_date_time error #322

leoluyi opened this issue May 11, 2015 · 6 comments
Labels
bug an unexpected problem or unintended behavior

Comments

@leoluyi
Copy link

leoluyi commented May 11, 2015

library(lubridate)

x <- c("09-01-01", "09-01-02", "09-01-03")

parse_date_time(x, "ymd")
# Error in (function (..., deparse.level = 1)  :   
# (converted from warning) number of columns of result is not a multiple of vector length (arg 3)

parse_date_time(x, "%y%m%d")
# Error in (function (..., deparse.level = 1)  :   
# (converted from warning) number of columns of result is not a multiple of vector length (arg 3)

parse_date_time(x, "%y %m %d")
# Error in (function (..., deparse.level = 1)  :   
# (converted from warning) number of columns of result is not a multiple of vector length (arg 3)

session_info

devtools::session_info()
Session info --------------------------------------------------------------------------------
setting  value                           
version  R version 3.2.0 (2015-04-16)    
system   x86_64, mingw32                 
ui       RStudio (0.99.435)              
language (EN)                            
collate  Chinese (Traditional)_Taiwan.950
tz       Asia/Taipei                     

Packages ------------------------------------------------------------------------------------
package   * version  date       source        
bitops      1.0-6    2013-08-17 CRAN (R 3.2.0)
devtools    1.8.0    2015-05-09 CRAN (R 3.2.0)
digest      0.6.8    2014-12-31 CRAN (R 3.2.0)
git2r       0.10.1   2015-05-07 CRAN (R 3.2.0)
lubridate * 1.3.3    2013-12-31 CRAN (R 3.2.0)
magrittr    1.5      2014-11-22 CRAN (R 3.2.0)
memoise     0.2.1    2014-04-22 CRAN (R 3.2.0)
plyr        1.8.2    2015-04-21 CRAN (R 3.2.0)
Rcpp        0.11.6   2015-05-01 CRAN (R 3.2.0)
RCurl       1.95-4.6 2015-04-24 CRAN (R 3.2.0)
rversions   1.0.0    2015-04-22 CRAN (R 3.2.0)
stringi     0.4-1    2014-12-14 CRAN (R 3.2.0)
stringr     1.0.0    2015-04-30 CRAN (R 3.2.0)
XML         3.98-1.1 2013-06-20 CRAN (R 3.2.0)
@vspinu
Copy link
Member

vspinu commented May 11, 2015

CRAN version of lubridate is very outdated. Please install from github for now. I hope to be able to release to CRAN by the end of the month.

> parse_date_time(x, "ymd")
[1] "2009-01-01 UTC" "2009-01-02 UTC" "2009-01-03 UTC"
> ymd(x)
[1] "2009-01-01 UTC" "2009-01-02 UTC" "2009-01-03 UTC"
> 

@vspinu vspinu closed this as completed May 11, 2015
@leoluyi
Copy link
Author

leoluyi commented May 11, 2015

Thanks for reply.
Using the latest github version, I still got error messages as above.

lubridate * 1.4.0.9500 2015-05-11 Github (hadley/lubridate@8bb248e)

@vspinu vspinu reopened this May 11, 2015
@vspinu
Copy link
Member

vspinu commented May 11, 2015

That means it has to do with your locale.

What is your locale as returned by Sys.getlocale("LC_TIME")?

@leoluyi
Copy link
Author

leoluyi commented May 12, 2015

> Sys.getlocale("LC_TIME")
[1] "Chinese (Traditional)_Taiwan.950"

@leoluyi
Copy link
Author

leoluyi commented May 12, 2015

Not until I set the locale to English_United States.1252 did it work well.
It seems to have locale problem.

Sys.setlocale(category = "LC_ALL", locale = "English_United States.1252")

x <- c("09-01-01", "09-01-02", "09-01-03")
parse_date_time(x, "ymd")
# "2009-01-01 UTC" "2009-01-02 UTC" "2009-01-03 UTC"

@vspinu
Copy link
Member

vspinu commented May 12, 2015

It seems to have locale problem.

Yes. It's the way non-english characters are parsed. I am swamped till 20th of May. Will fix this up afterwards.

@vspinu vspinu added the bug an unexpected problem or unintended behavior label May 12, 2015
@vspinu vspinu closed this as completed in 4be62b6 Nov 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants