[R] plot portion of a line

BBands bbands at gmail.com
Tue Jan 16 17:16:20 CET 2007


Dear HelpeRs,

Given:
x <- rnorm(50)
y <- rnorm(50)
plot(x,y)
abline(lm(x ~ y))

Is there a way to plot just a portion of the line? Say for values of x
> 2.0 or x > -2.0 and x < 4.0. (Still fitting all the points.)

Thank you,

    jab
-- 
John Bollinger, CFA, CMT
www.BollingerBands.com

If you advance far enough, you arrive at the beginning.



More information about the R-help mailing list