You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Working with data using the units and ggplot2 package, I found that setting up limits is not straight forward. I do not think this is the intended use, but I may be wrong.
The following should not work, since ylimit argument is not set in units.
It seems like the units package has recently added support for functions like ylim() but this hasn't arrived on CRAN yet.
Your second example works with their development version:
The state of the scale_y_units() documentation, or more generally —the level of units/ggplot2 interoperability— is outside the control of ggplot2 and should be raised with the units authors. As such, I think this issue should be closed.
Working with data using the
units
andggplot2
package, I found that setting up limits is not straight forward. I do not think this is the intended use, but I may be wrong.The following should not work, since
ylimit
argument is not set in units.So, my initial approach was to set the following just to find out it does not work either
Notice that the arguments
units::as_units(0, "km")
andunits::as_units(NA, "km")
do not give an error. Yet, I get an error when rendering the plot.The current solution uses
units::scale_y_units()
, but it is not straight forward or documented as a solution to this problem anywhere.Is this the intended approach when using units and ggplot scales and limits?
The text was updated successfully, but these errors were encountered: