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

geom_sina has problems with artificial data #48

Closed
idot opened this issue Dec 6, 2016 · 4 comments
Closed

geom_sina has problems with artificial data #48

idot opened this issue Dec 6, 2016 · 4 comments
Labels
bug an unexpected problem or unintended behavior

Comments

@idot
Copy link

idot commented Dec 6, 2016

I tried to test some things and geom_violin copes with my stupid test data, but geom_sina throws errors. Maybe thats indicative of some problems - I don't really know.

df <- data.frame(g=c("A","B"),v=rep(c(rep(5,20),rep(10,20),rep(15,20)),2))
ggplot(df, aes(x=1,y=v)) + geom_violin()
ggplot(df, aes(x=1,y=v)) + geom_sina() //Error in f(...) : could not find function "has_groups"
ggplot(df, aes(x=g,y=v)) + geom_violin()
ggplot(df, aes(x=g,y=v)) + geom_sina() //Warning: Computation failed in `stat_sina()`: 'vec' must be sorted non-decreasingly and not contain NAs
@thomasp85
Copy link
Owner

The first one has been fixed in the devel version of ggforce - I'll look into the second...

@thomasp85 thomasp85 added the bug an unexpected problem or unintended behavior label Dec 6, 2016
@thomasp85
Copy link
Owner

@sidiropoulos do you have time to look into this as well?

@sidiropoulos
Copy link
Contributor

@idot: Like @thomasp85 says, the first issue should be resolved if you install the devel version of geforce.
I've reproduced the second error. A temporary fix would be to try

df <- data.frame(g = c("A", "B"), v = rep(c(rep(5, 20), rep(10, 20), rep(15, 20)), 2))  
ggplot(df, aes(x = 1, y = v + 0.0001)) + geom_sina()

You can add more (or less) zeros. The choice in the example above is arbitrary.
It's a break in the findInterval() function which I will fix and submit.

Thanks for reporting this!

sidiropoulos added a commit to sidiropoulos/ggforce that referenced this issue Dec 11, 2016
thomasp85 pushed a commit that referenced this issue Dec 12, 2016
Fixes #41 #48 #51

* Bug fix for classes with one point. 
* Scaling class width to properly match the `maxwidth` parameter. 
* Added a tiny fuzz in ybins.
@thomasp85
Copy link
Owner

Fixed in #52

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants