Re: [R] Plotting more than one regression line in ggplot

2019-06-06 Thread rain1290--- via R-help
Hi Rui, Yes! This worked just fine! Thank you so, so much for your time and patience!  -Original Message- From: Rui Barradas To: rain1290 ; r-help Sent: Thu, Jun 6, 2019 3:25 pm Subject: Re: [R] Plotting more than one regression line in ggplot Hello, Try this. values_to_plot <

Re: [R] Plotting more than one regression line in ggplot

2019-06-06 Thread Rui Barradas
d = lm, se=FALSE) > > **//___^ > **//___^I still end up with the same error, however, when I specify only > 3 colors. Why could this be? > > > -Original Message- > From: Rui Barradas mailto:ruipbarra...@sapo.pt>> > To: rain1290 mailto:rain1...@aim.c

Re: [R] Plotting more than one regression line in ggplot

2019-06-06 Thread rain1290--- via R-help
scale_color_manual(values =c("green", "blue" "red", "black")) + geom_smooth(method = lm, se=FALSE) Thanks, -Original Message- From: Rui Barradas To: rain1290 ; r-help Sent: Thu, Jun 6, 2019 11:53 am Subject: Re: [R] Plotting more than one regression l

Re: [R] Plotting more than one regression line in ggplot

2019-06-06 Thread Rui Barradas
, "blue" "red")) + geom_smooth(method = lm, se=FALSE) **//___^ **//___^I still end up with the same error, however, when I specify only 3 colors. Why could this be? -Original Message- From: Rui Barradas To: rain1290 ; r-help Sent: Thu, Jun 6, 2019 11:18 am Subject

Re: [R] Plotting more than one regression line in ggplot

2019-06-06 Thread rain1290--- via R-help
+ geom_smooth(method = lm, se=FALSE) I still end up with the same error, however, when I specify only 3 colors. Why could this be? -Original Message- From: Rui Barradas To: rain1290 ; r-help Sent: Thu, Jun 6, 2019 11:18 am Subject: Re: [R] Plotting more than one regression line in ggp

Re: [R] Plotting more than one regression line in ggplot

2019-06-06 Thread Rui Barradas
quot; "red"" **//___^ Why would this error appear?  I think that I assigned the colors correctly to each of the four objects in question, so why would this occur? Thank you, once again! -----Original Message- From: Rui Barradas To: rain1290 ; r-help Sent: Thu, Jun 6, 201

Re: [R] Plotting more than one regression line in ggplot

2019-06-06 Thread PIKAL Petr
nual(values =c("green", "blue" "red"" > > Why would this error appear? I think that I assigned the colors correctly to > each of the four objects in question, so why would this occur? > Thank you, once again! > -Original Message- > From:

Re: [R] Plotting more than one regression line in ggplot

2019-06-06 Thread rain1290--- via R-help
ch of the four objects in question, so why would this occur?  Thank you, once again!  -Original Message- From: Rui Barradas To: rain1290 ; r-help Sent: Thu, Jun 6, 2019 6:52 am Subject: Re: [R] Plotting more than one regression line in ggplot Hello, You are confusing some of the values of L

Re: [R] Plotting more than one regression line in ggplot

2019-06-06 Thread Rui Barradas
ce would be greatly appreciated! -Original Message- From: Rui Barradas To: rain1290 ; r-help ; r-sig-geo Sent: Wed, Jun 5, 2019 10:52 am Subject: Re: [R] Plotting more than one regression line in ggplot Hello, This is pretty basic ggplot. lm1 <- ggplot(onepctCO2MEDIAN, aes(x, y

Re: [R] Plotting more than one regression line in ggplot

2019-06-05 Thread PIKAL Petr
ect: Re: [R] Plotting more than one regression line in ggplot > > Hi Rui (and everyone), > > Thank you so much for your response! Much appreciated! > What if I wanted I create several regression lines and scatter plots in the > same > ggplot using a "melted" datase

Re: [R] Plotting more than one regression line in ggplot

2019-06-05 Thread rain1290--- via R-help
Jun 5, 2019 10:52 am Subject: Re: [R] Plotting more than one regression line in ggplot Hello, This is pretty basic ggplot. lm1 <- ggplot(onepctCO2MEDIAN, aes(x, y)) +   geom_point(colour = 'blue') +   geom_smooth(method = 'lm') lm1 If you want to combine several datasets

Re: [R] Plotting more than one regression line in ggplot

2019-06-05 Thread David Winsemius
es(x,y), method=lm) # At some point you changed the column names from (RCP1pctCO2cumulativeMedian, departurea) to (x,y) , but didn't adjust your code. Best; David. -Original Message- From: Jeff Newmiller To: rain1290 ; rain1290--- via R-help ; r-help ; r-sig-geo Sent: Wed,

Re: [R] Plotting more than one regression line in ggplot

2019-06-05 Thread David Winsemius
> To: r-help > Sent: Wed, Jun 5, 2019 12:00 pm > Subject: Re: [R] Plotting more than one regression line in ggplot > > > On 6/5/19 8:04 AM, rain1290--- via R-help wrote: > > Hi Jeff (and everyone), > > > > Thank you for your response and feedback. Yes, I know what

Re: [R] Plotting more than one regression line in ggplot

2019-06-05 Thread rain1290--- via R-help
ld it work for the scatter plot and not the regression line? -Original Message- From: David Winsemius To: r-help Sent: Wed, Jun 5, 2019 12:00 pm Subject: Re: [R] Plotting more than one regression line in ggplot On 6/5/19 8:04 AM, rain1290--- via R-help wrote: > Hi Jeff (and everyon

Re: [R] Plotting more than one regression line in ggplot

2019-06-05 Thread David Winsemius
(x,y) , but didn't adjust your code. Best; David. -Original Message- From: Jeff Newmiller To: rain1290 ; rain1290--- via R-help ; r-help ; r-sig-geo Sent: Wed, Jun 5, 2019 10:49 am Subject: Re: [R] Plotting more than one regression line in ggplot Please read the Posting Gu

Re: [R] Plotting more than one regression line in ggplot

2019-06-05 Thread Rui Barradas
Hello, And please don't cross post. You have asked both r-help@r-project.org and r-sig-...@r-project.org when you should have asked just one of them. This is a question for r-help@r-project.org Rui Barradas Às 15:52 de 05/06/19, Rui Barradas escreveu: Hello, This is pretty basic ggplot.

Re: [R] Plotting more than one regression line in ggplot

2019-06-05 Thread rain1290--- via R-help
r-sig-geo Sent: Wed, Jun 5, 2019 10:49 am Subject: Re: [R] Plotting more than one regression line in ggplot Please read the Posting Guide... posting HTML on a plain text mailing list really interferes with clear communication. If you had spent even a small amount of time working with R tutorials

Re: [R] Plotting more than one regression line in ggplot

2019-06-05 Thread Rui Barradas
Hello, This is pretty basic ggplot. lm1 <- ggplot(onepctCO2MEDIAN, aes(x, y)) + geom_point(colour = 'blue') + geom_smooth(method = 'lm') lm1 If you want to combine several datasets, you will have to have a variable telling which dataset is which. In the example below, this is column 'i

Re: [R] Plotting more than one regression line in ggplot

2019-06-05 Thread Jeff Newmiller
Please read the Posting Guide... posting HTML on a plain text mailing list really interferes with clear communication. If you had spent even a small amount of time working with R tutorials then you would know that "lm" is the name of a very basic, very important R function. However, you are def

[R] Plotting more than one regression line in ggplot

2019-06-05 Thread rain1290--- via R-help
I am trying to plot, using ggplot, a series of scatter plots with regression lines for several datasets. I started with the following dataset, "onepectCO2MEDIAN". The data for this dataset is as follows:     onepctCO2MEDIAN     x  y     layer.1   0.0  0.000