What I'd like to do is label both of the geom_bar() 's in the following example with their respective data labels. So far, I can only get one or the other to show up:
dput():
x <- structure(list(variable = c("a", "b", "c"), f = c(0.98, 0.66,
0.34), m = c(0.75760989010989, 0.24890977443609, 0.175125)), .Names = c("variable",
"f", "m"), row.names = c(NA, 3L), class = "data.frame")
ggplot(x, aes(variable, f, label=paste(f*100,"%", sep=""))) +
geom_bar() +
geom_text(size=3, hjust=1.3, colour="white") +
geom_bar(aes(variable, m, label=paste(m*100,"%",sep="")), fill="purple") +
coord_flip()
See how on the inside of the black there is a data label. In the same plot, I'd like to do the same thing on the inside of the purple.