[R] Plotting only masked part of data
Joakim Hove
hove at ift.uib.no
Tue Jan 25 15:21:03 CET 2005
Barry Rowlingson <B.Rowlingson at lancaster.ac.uk> writes:
>> Is there a simple general solution to my problem?
>
> Plot will draw disconnected lines if there are NA values in the
> vector of X or Y values, so if you do:
>
> > x <- seq(0,4*pi,by=0.1)
> > y <- sin(x)
> > x[abs(y)>=0.5]=NA
> > y[abs(y)>=0.5]=NA
> > plot(x,y,type='l')
That solved it immediately - thanks a lot.
Joakim
--
Joakim Hove
hove AT ift uib no
Tlf: +47 (55 5)8 27 90
Fax: +47 (55 5)8 94 40
http://www.ift.uib.no/~hove/
More information about the R-help
mailing list