Dambo Dambo - 1 year ago 97
R Question

How to prevent ggvis from showing html encoding for special characters?

I have this a chart with

in a variable, I do I prevent ggvis from replacing
with its html code on the x-axis label?

data.frame(x="& label", y=10) %>%
ggvis(~x, ~y) %>%

Answer Source

Got it! The regular ampersand won't work but the "full width" version does using C/C++/Java source code unicode format:

title <- "\uFF06"
mtcars %>% ggvis(x = ~wt, y = ~mpg, fill = ~cyl) %>%
  layer_points() %>%
  add_legend("fill", title = "Cylinders")  %>%

enter image description here


Note that the "regular" ampersand character I was talking about that won't work is unicode \u0026

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download