Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a="year total boy girl
- 1 106 16526 9377 7149
- 2 105 16499 9403 7096
- 3 104 16532 9441 7091
- 4 103 16505 9425 7080
- 5 102 16575 9456 7119
- 6 101 16915 9609 7306
- 7 100 17277 9703 7574
- 8 99 17514 9770 7744
- 9 98 17492 9774 7718
- 10 97 17152 9504 7648"
- aa=read.table(text=a)
- ggplot(aa,aes(x=year,y=value,col=variable))+
- geom_point(aes(y=total, col = "total"))+
- geom_line(aes(y=total, col = "total"))+
- geom_point(aes(y=boy,col="boy"))+
- geom_line(aes(y=boy,col="boy"))+
- geom_point(aes(y=girl,col="girl"))+
- geom_line(aes(y=girl,col="girl"))+
- scale_color_manual(values=c("red","blue","black" ))
- library(reshape2)
- aaa=melt(aa,id="year")
- ggplot(aes(x=year,y=value,color=variable),data=aaa)+
- geom_point()+geom_line()+
- scale_color_manual(values=c("black", "red", "blue"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement