xlab=”Year”,ylab=”Expenditures/GDP (%)”) # adds titles to the axes lines(year,defense,col=”red”,lwd=2.5) # adds a line for defense expenditures lines(year,health,col=”blue”,lwd=2.5) # adds a line for he
Let’s first set up a basic plot to experiment with: library(legendry)#> Loading required package: ggplot2base<-ggplot(mpg, aes(displ,hwy,colour=cty))+geom_point()+labs(x="Engine displacement",y="Highway miles per gallon",col="City miles\nper gallon")+theme(axis.line=element_line()...