Re: [R] How to plot linear, cubic and quadratic fitting curve in a figure?

2012-06-13 Thread David Winsemius
On Jun 13, 2012, at 10:29 AM, Kristi Glover wrote: Hi R experts, Could you please help me to fit a linear, cubic and quadratic curve in a figure? I was trying to show all these three fitting curves with different colour in one figure. I spent substantial time to figure it out, but I could

Re: [R] How to plot linear, cubic and quadratic fitting curve in a figure?

2012-06-13 Thread Frank Harrell
el type takes care of the details. > > Bill Dunlap > Spotfire, TIBCO Software > wdunlap tibco.com > > >> -Original Message- >> From: r-help-bounces@ [mailto:r-help-bounces@] On Behalf >> Of Robert Baer >> Sent: Wednesday, June 13, 2012 8:40 AM >> To: Kr

Re: [R] How to plot linear, cubic and quadratic fitting curve in a figure?

2012-06-13 Thread William Dunlap
oject.org] On > Behalf > Of Robert Baer > Sent: Wednesday, June 13, 2012 8:40 AM > To: Kristi Glover; R-help > Subject: Re: [R] How to plot linear, cubic and quadratic fitting curve in a > figure? > > > > dput(test) > structure(list(sp = c(4L, 5L, 9L, 12L, 14L), e

Re: [R] How to plot linear, cubic and quadratic fitting curve in a figure?

2012-06-13 Thread Robert Baer
dput(test) structure(list(sp = c(4L, 5L, 9L, 12L, 14L), env = c(12L, 18L, 20L, 17L, 15L)), .Names = c("sp", "env"), class = "data.frame", row.names = c(NA, -5L)) plot(test$sp~test$env, main = "S vs. temp", xlim=c(0,20), ylim=c(0,14), ylab="S",xlab="env") linear<-lm(test$sp~test$env) quadrat

Re: [R] How to plot linear, cubic and quadratic fitting curve in a figure?

2012-06-13 Thread Kenneth Frost
Hi, Kristi- Here is an option. ?curve...to add the polynomials to your graph ?textfor adding the R2 to you plot Ken On 06/13/12, Kristi Glover wrote: > > Hi R experts, > Could you please help me to fit a linear, cubic and quadratic curve in a > figure? I was trying to show all these three

[R] How to plot linear, cubic and quadratic fitting curve in a figure?

2012-06-13 Thread Kristi Glover
Hi R experts, Could you please help me to fit a linear, cubic and quadratic curve in a figure? I was trying to show all these three fitting curves with different colour in one figure. I spent substantial time to figure it out, but I could not. I have given here a example and what I did for l