I am having to use base R and I am only really familiar with ggplot2. I have told R to colour my plot by site, which it has done... but unlike ggplot2 it doesn't automatically give me a legend to tell me which colour it has assigned to which site. Is there either a way to tell R to plot a site in a specific colour or a way to make it create a legend. I tried creating a legend but it seemed I had to input exactly what colour, shape etc should be on the legend which defeats the point.
Thanks.
plot(mod1.xval, xval=TRUE, resid=TRUE, xlab="Observed elevation (m AHD)", ylab= "Inferred elevation (m AHD)",npls=2,col=spec$Site)
