My data looks like this.
Week Africa Americas Asia Europe Oceania Burma Cambodia China..Guangxi. China..Yunnan. Laos Thailand Vietnam
1 5 0 6 2912 4 5 0 1 46 26 0 8 2
2 6 0 15 19827 33 12 0 1 127 117 0 19 8
3 7 0 19 42551 49 15 0 1 210 149 0 32 14
4 8 1 22 72721 57 15 0 1 238 171 0 35 16
5 9 1 28 78517 294 15 0 1 251 174 0 35 16
6 10 8 105 86698 2828 31 0 1 252 174 0 43 16
When I want to graph this in ggplot2 is will give me the graph but not the legend indicating whicbh line-color belongs to which group. How can I add that to my graph?
ggplot(data=df, aes(x=Week))+
geom_line(aes(y=Africa), color= "#8dd3c7")+
geom_line(aes(y=Americas), color= "#ffffb3")+
geom_line(aes(y=Asia), color= "#bebada")+
geom_line(aes(y=Europe), color= "#fb8072")+
geom_line(aes(y=Oceania), color= "#80b1d3")+
geom_line(aes(y=Burma), color= "#fdb462")+
geom_line(aes(y=Cambodia), color= "#b3de69")+
geom_line(aes(y=China..Guangxi.), color= "#fccde5")+
geom_line(aes(y=China..Yunnan.), color= "#d9d9d9")+
geom_line(aes(y=Laos), color= "#bc80bd")+
geom_line(aes(y=Thailand), color= "#ccebc5")+
geom_line(aes(y=Vietnam), color= "#ffed6f")
Is the data format I'm providing wrong so I wont do this automatically or what am I doing wrong here?
Cheers, J
