Hi,
I have the next script in R:
x=c(8.0,17.5,23.5,32.0,38.5,48.5,58.5,68.5)
y=c(267,246,290,294,302,301,301,298)
gap.plot(x,y,ylim=c(8,310),pch=8,cex=0.5,
xlab=c('Time'),ylab=c('uS'),
gap=c(30,240),gap.axis='y',
ytics=c(10,20,30,270,280,290,300))
abline(h=31,col='white',lwd=20)
axis.break(axis=2,31)
axis.break(axis=4,31)
abline(coef(lm(x~y)),col=1)#Why don't show this???
Thank's for Your help,
Péter
--
Domokos Péter
<><
BSc student
Babes-Bolyai University
Biology and Geology Faculty
Hungarian Department of Biology and Ecology
Cluj Napoca
Romania
[[alternative HTML version deleted]]
I have no idea where gap.plot() came from, so I can't reproduce this, but you almost certainly need y ~ x in your formula. abline(coef(lm(y ~ x)),col=1) Sarah On Fri, Nov 8, 2013 at 11:04 AM, Domokos P?ter <domszi at gmail.com> wrote:> Hi, > > I have the next script in R: > > x=c(8.0,17.5,23.5,32.0,38.5,48.5,58.5,68.5) > y=c(267,246,290,294,302,301,301,298) > > gap.plot(x,y,ylim=c(8,310),pch=8,cex=0.5, > xlab=c('Time'),ylab=c('uS'), > gap=c(30,240),gap.axis='y', > ytics=c(10,20,30,270,280,290,300)) > abline(h=31,col='white',lwd=20) > axis.break(axis=2,31) > axis.break(axis=4,31) > > abline(coef(lm(x~y)),col=1)#Why don't show this??? > > Thank's for Your help, > P?ter > >-- Sarah Goslee http://www.functionaldiversity.org
On 11/09/2013 03:04 AM, Domokos P?ter wrote:> Hi, > > I have the next script in R: > > x=c(8.0,17.5,23.5,32.0,38.5,48.5,58.5,68.5) > y=c(267,246,290,294,302,301,301,298) > > gap.plot(x,y,ylim=c(8,310),pch=8,cex=0.5, > xlab=c('Time'),ylab=c('uS'), > gap=c(30,240),gap.axis='y', > ytics=c(10,20,30,270,280,290,300)) > abline(h=31,col='white',lwd=20) > axis.break(axis=2,31) > axis.break(axis=4,31) > > abline(coef(lm(x~y)),col=1)#Why don't show this??? >Hi Peter, Perhaps because both of these numbers: coef(lm(x~y)) (Intercept) y -176.5047160 0.7425131 are off the scale of your plot. Do you really want: lmcoef<-coef(lm(y~x)) abline(lmcoef[1]-210,lmcoef[2],col=1) Jim