I have 4 dataframes, which all have a column called Results showing Wins, Draws, Losses. I would like to create a layered histogram as the picture below. Any idea if it is achievable in R?
This is what I was playing with:
ggplot(results, aes(x = Country, y = ??)) +
geom_bar(aes(fill = Performance), stat = "identity")
Problem with this is I don't know what should I set the y axis to be. These are supposed to be counts
Another option I tried which is almost what I want is this:
counts <- table(results$Performance, results$Country)
barplot(counts, main="Game Count per Football Team",
xlab="Football Teams", ylab = "Game Count", col=c("darkblue","red", "Yellow"),
legend = rownames(counts))
Although the y axis stop at 800 although I have 908 observations max in one of the countries