Skip to content
Prev 324232 / 398503 Next

Indexing within by statement - different coloured lines in abline wanted..

Slightly diffferent approach but will this do what you want.

library(ggplot2)
  ggplot(Data1, aes(Predictor, Response1, colour = Site)) +
     geom_smooth(method= "lm", se = FALSE) +
     ggtitle("Raw data with linear regresssions by Site")

John Kane
Kingston ON Canada
____________________________________________________________
Share photos & screenshots in seconds...
TRY FREE IM TOOLPACK at http://www.imtoolpack.com/default.aspx?rc=if1
Works in all emails, instant messengers, blogs, forums and social networks.