-
Notifications
You must be signed in to change notification settings - Fork 108
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
scale_x_date or maybe date_format has problems with some dates (e.g. 4-01-31) #25
Comments
It looks like the problem is happening because sometimes the breaks have negative years, and x <- as.Date(c("0001-01-24", "0500-02-02"))
as.character(x)
# "0001-01-24" "0500-02-02"
as.Date(as.character(x))
# Minus 391 days gives negative year
as.character(x - 391)
# "-001-12-30" "0499-01-07"
as.Date(as.character(x - 391))
# Error during wrapup: character string is not in a standard unambiguous format |
A right, I forgot that I asked about this on r-help [1], but never got an answer. [1] http://r.789695.n4.nabble.com/Date-object-and-origin-BC-tp4173163.html |
I just asked the same thing on r-devel, but no helpful replies yet. https://stat.ethz.ch/pipermail/r-devel/2012-July/064398.html It might be a "feature" instead of a bug, at least to the core R developers. |
Fixing this is going to be hard - I think it you could extract the necessary bits out of |
Same problem, found solution here: https://www.r-bloggers.com/2021/09/error-in-character-string-is-not-in-a-standard-unambiguous-format/ |
With some dates, e.g. dates like 4-01-31 or lower is get the following error message:
Error in charToDate(x) :
character string is not in a standard unambiguous format
Here is an example:
The text was updated successfully, but these errors were encountered: