Hello everybody, I have drawn a line in a x y plot that links the minimum and maximum points in the plot plot(xx,yy) a=max(yy) b=min(yy) lines(c(xx[yy==a],xx[yy==b]),c(a,b)) Now I would like to know if it is possible to extrapolate the characteristic of the line (intercept and slope). Is it there and appropriate function for this? Thanks for your help! Ida D. -- Ida Dolciotti, M.Sc. Phd student, Dept. System Ecotoxicology Helmholtz Centre for Environmental Research - UFZ Permoserstr. 15 04318 Leipzig phone: +49 - 341/235-1498 fax: +49 - 341/235-1785 email: ida.dolciotti at ufz.de website: http://www.ufz.de/index.php?en=17738
lm()? Or simple geometry? lm(c(a,b) ~ c(xx[yy==a],xx[yy==b])) will give you the slope and the intercept. Sarah On Wed, Jun 29, 2011 at 5:38 AM, Ida Dolciotti <ida.dolciotti at ufz.de> wrote:> Hello everybody, > > I have drawn a line in a x y plot ?that links the minimum and maximum points > in the plot > > plot(xx,yy) > > a=max(yy) > b=min(yy) > > lines(c(xx[yy==a],xx[yy==b]),c(a,b)) > > Now I would like to know if it is possible to extrapolate the characteristic > of the line (intercept and slope). > > Is it there and appropriate function for this? > > Thanks for your help! > > Ida D. > > ---- Sarah Goslee http://www.functionaldiversity.org
Hi r-help-bounces at r-project.org napsal dne 29.06.2011 11:38:17:> Ida Dolciotti <ida.dolciotti at ufz.de>> Hello everybody, > > I have drawn a line in a x y plot that links the minimum and maximum > points in the plot > > plot(xx,yy) > > a=max(yy) > b=min(yy) > > lines(c(xx[yy==a],xx[yy==b]),c(a,b)) > > Now I would like to know if it is possible to extrapolate the > characteristic of the line (intercept and slope). > > Is it there and appropriate function for this?Maybe ?abline Regards Petr> > Thanks for your help! > > Ida D. > > -- > Ida Dolciotti, M.Sc. > Phd student, Dept. System Ecotoxicology > Helmholtz Centre for Environmental Research - UFZ > Permoserstr. 15 > 04318 Leipzig > > phone: +49 - 341/235-1498 > fax: +49 - 341/235-1785 > > email: ida.dolciotti at ufz.de > website: http://www.ufz.de/index.php?en=17738 > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html> and provide commented, minimal, self-contained, reproducible code.