How to remove mysterious tilda from R Plotly tooltip?
How to remove mysterious tilda from R Plotly tooltip?
I’m using R's ggplot and passing it through ggplotly to generate interactive charts on my Shiny app. However, I have no idea why my tooltip keeps displaying a “~” sign before the variable name and I can’t seem to remove it. This appears for all my charts in my Shiny app. How can I remove the “~”? I've tried to customise the tooltip for the plotly argument but nothing seems to work...
Does anyone know the solution to this?

Here's my sample code:
dat <- data.frame(
ageGroups = factor(c("18-25","26-35", "36-45", "46-55", "56 and Above"),
levels=c("18-25","26-35", "36-45", "46-55", "56 and Above")),
ageCount = c(25,66,43,21,5)
)
p <- ggplot(data=dat, aes(x=ageGroups, y=ageCount, fill=ageGroups)) +
geom_bar(stat="identity", width = 0.8) +
xlab("Age Groups") +
ylab("No. of Users") +
theme_minimal() +
theme(legend.position = "bottom") +
scale_fill_brewer(palette = "Blues")
ggplotly(p, tooltip = "y")
Hi RLave, I've updated my question with the sample code. Does this help?
– ZPeh
Sep 15 '18 at 17:17
To me it shows correctly just
ageCount: 43, no "~". Maybe update your plotly version?– RLave
Sep 17 '18 at 6:39
ageCount: 43
plotly
You're absolutely right! I've updated my plotly version and it seems to be working now. Thanks!
– ZPeh
Sep 20 '18 at 3:09
0
Thanks for contributing an answer to Stack Overflow!
But avoid …
To learn more, see our tips on writing great answers.
Required, but never shown
Required, but never shown
By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy
Hi! Can you please share the code you used?
– RLave
Sep 11 '18 at 6:31