Re: [R] Plot with two different coloured regression lines and legend

2008-03-04 Thread John Kane
Untested but abline(lm(sabund[[i]]~sbif[[i]]), col=i) may do it. It would be better to have a working example to test. --- yvo <[EMAIL PROTECTED]> wrote: > > It is a trivial problem, but in the book I couln`t > figure out how to put > different colours at different regression lines > > plot(bi

[R] Plot with two different coloured regression lines and legend

2008-03-04 Thread yvo
It is a trivial problem, but in the book I couln`t figure out how to put different colours at different regression lines plot(bif,abund,type="n", xlab= "number_bifurcations", ylab="abundances") sbif<-split(bif,stage) sabund<-split(abund,stage) points(sabund[[2]],sbif[[2]],pch=16, col="red") for(