[R] abline?

Olivier Crouzet olivier.crouzet at univ-nantes.fr
Thu Jan 22 22:46:06 CET 2015


> >
> > plot(r2,d)
> > res = lm(r2~d)
> >
> Mixing up your x and y coordinate.  Do:
> 
> plot(d,r2)

... or use:

plot(r2 ~ d)

so that

res <- lm(r2 ~ d)

uses exactly the same pattern...

Olivier.

-- 
  Olivier Crouzet, PhD
  Laboratoire de Linguistique -- EA3827
  Université de Nantes
  Chemin de la Censive du Tertre - BP 81227
  44312 Nantes cedex 3
  France

     phone:        (+33) 02 40 14 14 05 (lab.)
                   (+33) 02 40 14 14 36 (office)
     fax:          (+33) 02 40 14 13 27
     e-mail:       olivier.crouzet at univ-nantes.fr
 		
  http://www.lling.univ-nantes.fr/



More information about the R-help mailing list