Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
scale_x_date passes NAs to the label function #2182
Comments
|
Could you please provide a minimal reproducible example using the reprex package? I'm having trouble reproducing the example from that SO link. |
karawoo
added the
reprex
label
Jul 10, 2017
ggrothendieck
commented
Jul 11, 2017
•
|
This fails with an error message.; howver, if we uncomment the line containing
The output of the
|
ggrothendieck commentedJun 26, 2017
•
edited
When using
scale_x_date(..., label = fun)it can be that NAs are passed tofunwhich adds undesirable complexity to the definition of the function.See this example:
https://stackoverflow.com/questions/44616530/prevent-showing-the-year-several-times-unnecessarily-with-time-series/44751923#44751923
where this line had to be added to avoid errors even though the NAs do not actually correspond to breaks:
Any date could have been used in place of
Sys.Date()since it seems that the date itself is not actually used if the passed break is NA.