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

Error when NA is passed in limits for y axis #42

Closed
rcalinjageman opened this issue May 29, 2019 · 2 comments

Comments

@rcalinjageman
Copy link

commented May 29, 2019

I am encountering an issue when using ggbeeswarm and setting NA for limits on the y_axis.

Here's the code that reproduces the problem

library(ggplot2)
library(ggbeeswarm)
myplot <- ggplot(iris, aes(x=Species, y=Sepal.Length)) + scale_y_continuous(limits = c(0,NA)) + geom_beeswarm()
myplot

And this gives:

Error in if (limDiff == 0) limDiff <- 1 : 
  missing value where TRUE/FALSE needed

If I switch to:
myplot <- ggplot(iris, aes(x=Species, y=Sepal.Length)) + scale_y_continuous(limits = c(0,10)) + geom_beeswarm()
then the plot renders correctly

@sherrillmix

This comment has been minimized.

Copy link
Collaborator

commented Aug 12, 2019

Sorry somehow I didn't notice this issue until now. I can't seem to replicate it currently (i.e. ggplot(iris, aes(x=Species, y=Sepal.Length)) + scale_y_continuous(limits = c(0,NA)) + geom_beeswarm() runs without an error) so I wonder if whatever was causing the issue has been fixed in the meantime. Is it still causing problems for you?

@sherrillmix

This comment has been minimized.

Copy link
Collaborator

commented Aug 14, 2019

I should clarify that I could replicate the problem in v0.6.0 but the current github version appears to have fixed this (there was a major rewrite of beeswarm code). Let me know know if the problem is still there for you in the current version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.