-
Notifications
You must be signed in to change notification settings - Fork 43
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: allowing parsing #64
Comments
Hi Indrajeet, |
Agree this would be a useful feature.
Otherwise thank you for a supremely useful package! |
Hi, Note that you have to call the function with # setup
library(tidyverse)
library(ggsignif)
# creating a dataframe
(df <- tibble::tribble(
~x, ~lab,
1, "p < 0.001",
2, paste("list(~italic(p)<=", "0.001", ")", sep = "")
))
#> # A tibble: 2 x 2
#> x lab
#> <dbl> <chr>
#> 1 1 p < 0.001
#> 2 2 list(~italic(p)<=0.001)
# ggplot supports parsing
ggplot(mtcars, aes(as.character(am), wt)) +
geom_point() +
geom_signif(annotations = df$lab[2], comparisons = list(c("0", "1"))) +
labs(x = parse(text = df$lab[2])) # ggplot supports parsing
ggplot(mtcars, aes(as.character(am), wt)) +
geom_point() +
geom_signif(annotations = df$lab[2], comparisons = list(c("0", "1")),
parse=TRUE) +
labs(x = parse(text = df$lab[2])) Created on 2019-08-05 by the reprex package (v0.3.0) It would be great if you could test if this solves your issue. If so, I would try to push an updated version to CRAN in the coming days. Best, Constantin |
Dear Constantin, Thank you so much for implementing this! I can confirm that this is working as expected. |
The update version is now on CRAN :) |
ggplot
and some of its extensions (e.g,ggrepel
) allow the labels to be parsed into expressions and displayed as described inplotmath
. But, as far as I understandggsignif
, this is currently possible?Will you consider supporting it? Thanks.
Created on 2019-07-02 by the reprex package (v0.3.0)
Session info
The text was updated successfully, but these errors were encountered: