I am using the ggplotly function to turn a static ggplot2 bar graph into an interactive one.
However, my output returns a graph with encoding issues - shown below.
My ggplot2 graph is fine though.
Edit: Dataframe below
head(test2)
IRO_NAME_AND_SURNAME correct incorrect percent
## 1 НАУМ ДИМИТРОВСКИ 0 2 100.00000
## 2 АЛЕКСАНДАР МИРЧЕСКИ 1708 460 21.21771
## 3 НАДИЦА ИЛОСКА НИКОЛОСКА 1736 440 20.22059
## 4 ЕЛЕНА ТОДОРОСКА 2009 472 19.02459
## 5 ГОЦЕ ПУПАЛЕВСКИ 849 186 17.97101
## 6 АНА МИЛЕСКА ЛАТКОСКА 2155 447 17.17909
Creation of ggplot2 object.
b <- ggplot(test2, aes(as.factor(IRO_NAME_AND_SURNAME), percent)) +
geom_bar(position="dodge",stat="identity", fill = "deepskyblue4") +
coord_flip() +
theme(legend.title=element_blank()) +
ggtitle(expression(atop(bold("test test test"), atop(italic("NBI: 2011 - 2016"), "")))) +
xlab("") + ylab("") +
geom_text(aes(label=percent), color='white')
ggplotly(b)