I have the following dataframe:
and I am trying to add geom_point for columns: radiopred, tvpred, newspaperpred and allpred. But I need to add a legend to distinguish between points from the 4 columns.
ggplot() +
geom_point(mapping=aes(x=Sales,y=allpred), colour='blue') +
geom_point(mapping=aes(x=Sales,y=radiopred), colour='red') +
geom_point(mapping=aes(x=Sales,y=tvpred), colour='green') +
geom_point(mapping=aes(x=Sales,y=newspaperpred), colour='purple')
Just missing the legend.