Skip to content

Call for feature: supporting of expressions #1091

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

Open
bioinformatist opened this issue Aug 2, 2017 · 3 comments
Open

Call for feature: supporting of expressions #1091

bioinformatist opened this issue Aug 2, 2017 · 3 comments

Comments

@bioinformatist
Copy link

When I try use expression object as lab labels, ggplotly raises an error.

p <- ggplot(data=de$table, aes(x=logFC, y=-log10(PValue), colour=threshold)) +
        geom_point(size=1.75, alpha = 0.4) +
        # ylim(c(0, input$ylmslider)) +
        xlab(expression("log"[2]*"(Fold Change)")) + ylab(expression("-log"[10]*"(p-value)")) +
        geom_vline(xintercept = 0, colour = "grey",
  linetype = "dashed", size = 2) + # add line at 0
        geom_hline(yintercept = -log10(0.05), colour = "grey",
  linetype = "dashed", size = 2) + theme(legend.position = "none") # p(0.05) = 1.3
#> Everything is ok up to now
ggplotly(p)
#> Error in unique.default(x) : unimplemented type 'expression' in 'HashTableSetup'

You can reproduce this scenario by using any expression as axis titles.

@cpsievert
Copy link
Collaborator

cpsievert commented Aug 3, 2017

This is a hard problem which I've looked into -- http://rpubs.com/cpsievert/268872

It seems this is going to take a lot of effort that won't be worth it, but once #375 is closed, you'll be able to write TeX, which one could argue is better https://robjhyndman.com/hyndsight/latex2exp/

@baderstine
Copy link

ah, had same exact error attempting to make same plot labels! Fold Change vs. negative log p-value is the 'volcano plot'.

@DarioS
Copy link

DarioS commented Oct 22, 2024

Could the error message be improved, at least? It does not give the user a clear indication of what is wrong.

Error in unique.default(x) : 
  unimplemented type 'expression' in 'duplicated'

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

No branches or pull requests

4 participants