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

Issues with lubridate in function trajectory_read #38

Closed
DesperationSoftware opened this issue Aug 29, 2019 · 2 comments
Closed

Issues with lubridate in function trajectory_read #38

DesperationSoftware opened this issue Aug 29, 2019 · 2 comments

Comments

@DesperationSoftware
Copy link

Dear Rich,

I'm fairly new to both R and GitHub so sorry if this is not the appropriate way of doing this. Nevertheless, I found a significant bug in running SplitR and thought that was a good idea to share.

At line 43 of trajectory_read the lubridate::ymd_h function fails in parsing the date_h_string unless the system locale is English/American.

On my Italian computer if I run the standard example of hysplit_trajectory, it returns a trajectory with only NAs in traj_dt and traj_dt_i and issues Warning: All formats failed to parse. No formats found. per every ymd_h call.

If I instead set my system locale to English/American with Sys.setlocale("LC_ALL","English_United States.1252") the function runs correctly and the columns are filled with date and times.

Apparently, unless the locale is English/American lubridate::ymd_h is not able to parse dates in the format "yyyy-mm-dd h".

Maybe it is possible to insert some kind of workaround in the code to maximize the portability of SplitR in systems with different locales?

Anyhow thank you for the great job!

@rich-iannone
Copy link
Owner

Thanks for creating this issue! I'll have a closer look at this soon and fix the date-parsing so that it's independent of the locale.

@rich-iannone
Copy link
Owner

The function has been completely rewritten and doesn’t contain any lubridate function calls now. Could you test and make sure it works for your locale? Closing this issue for now but will re-open the issue if the problem persists.

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

No branches or pull requests

2 participants