Мы могли бы использовать следующее:
library(dplyr)
library(ggplot2)
library(tidyr)
dat %>%
mutate(Year=row.names(.)) %>%
gather(key,value,-c(Year,Total_Population)) %>%
ggplot(aes(Year,Total_Population,fill=key))+
geom_bar(stat="identity")
В качестве альтернативы:
dat %>%
mutate(Year=row.names(.)) %>%
gather(key,value,-c(Year,Total_Population)) %>%
ggplot(aes(Year,value,fill=key))+
geom_bar(stat="identity",position="dodge")
Данные :
dat<-structure(list(Total_Population = c(60510L, 60995L, 61437L, 61933L,
62448L, 62864L, 63230L, 63653L, 64212L), United_Kingdom = c(54102L,
54225L, 54415L, 54699L, 54787L, 55042L, 55309L, 55375L, 55642L
), EEA = c(1999L, 2154L, 2235L, 2331L, 2580L, 2671L, 2762L, 3042L,
3204L), Non_EEA = c(4409L, 4615L, 4787L, 4903L, 5080L, 5151L,
5160L, 5236L, 5365L)), class = "data.frame", row.names = c("2007",
"2008", "2009", "2010", "2011", "2012", "2013", "2014", "2015"
))