I need to use gghighlight in a clustered bar chart in R in order to highlight only one single bar. My code and sample data looks like this:
library(tidyr)
library(ggplot2)
dat <- data.frame(country=c('USA','Brazil','Ghana','England','Australia'), Stabbing=c(15,10,9,6,7), Accidents=c(20,25,21,28,15), Suicide=c(3,10,7,8,6))
dat.m <- melt(dat, id.vars='country')
dat.g <- gather(dat, type, value, -country)
ggplot(dat.g, aes(type, value)) +
geom_bar(aes(fill = country), stat = "identity", position = "dodge") +
gghighlight(type == "Accidents" & country == "Brazil")
But this gives me this awkward
How can I get gghighlight to highlight only one single bar of one group (so combining two conditions for two discrete variables)?