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

Feature request: annotate horizontal geoms #27

Closed
thomasjwood opened this issue Jul 31, 2017 · 2 comments
Closed

Feature request: annotate horizontal geoms #27

thomasjwood opened this issue Jul 31, 2017 · 2 comments
Labels

Comments

@thomasjwood
Copy link

wonderful package--you've address a huge lacunae in the ggplot ecosystem!

I wonder if you've thought about something which is a pretty natural extension--annotating comparable horizontal geoms? for instance:

library(ggplot2)
library(ggsignif)
library(ggstance)

ggplot(iris, aes(y=Species, x=Sepal.Length)) +
  geom_boxploth() +
  geom_signif(comparisons = list(c("versicolor", "virginica")), 
          map_signif_level=TRUE)

results in

Warning messages:
1: In f(..., self = self) : NAs introduced by coercion
2: Computation failed in `stat_signif()`:
missing value where TRUE/FALSE needed 
@const-ae
Copy link
Owner

const-ae commented Aug 3, 2017

Thanks, I am happy to hear that you like the package.

Yes, you are right it would be a natural extension to enable support for horizontal comparisons, but unfortunately I am quite busy right now and don't have the time to add that feature myself.

Of course I would be very happy to accept a pull request and provide help if somebody wants to try.

@IndrajeetPatil
Copy link
Collaborator

A workaround is to use coord_flip() instead of using ggstance:

library(ggplot2)
library(ggsignif)

ggplot(mpg, aes(class, hwy)) +
  geom_boxplot() +
  geom_signif(comparisons = list(c("compact", "pickup"),
                                 c("subcompact", "suv"))) +
  coord_flip()
#> Warning in wilcox.test.default(c(29, 29, 31, 30, 26, 26, 27, 26, 25, 28, :
#> cannot compute exact p-value with ties

Created on 2021-01-13 by the reprex package (v0.3.0)

At any rate, ggstance is not supposed to be used any more: https://github.com/lionel-/ggstance

Screenshot 2021-01-13 at 10 02 31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants