RE: [R] Missing Data Line Type?

From: <OlsenN_at_pac.dfo-mpo.gc.ca>
Date: Wed 25 May 2005 - 07:18:48 EST


The dashed line can be added to the plot with a call to "lines" after removing the NAs from your x/y vectors (I'm assuming 'missing' means NA).

> plot(x,y,type='l')
> lines(x[!is.na(y)],y[!is.na(y)],lty=2)

Vertical lines can be accomplished with "segments".

norm

-----Original Message-----
From: r-help-bounces@stat.math.ethz.ch
[mailto:r-help-bounces@stat.math.ethz.ch] On Behalf Of khobson@fd9ns01.okladot.state.ok.us
Sent: Tuesday, May 24, 2005 1:39 PM
To: r-help@stat.math.ethz.ch
Subject: [R] Missing Data Line Type?

I have a general question. Is there a setting that can be used for a multiple line type? The situation is that I want a solid line between x and y points but if the y point is missing, I want a dashed line type to the next point. In other words, if point 1 to 2 exists, make that line solid, otherwise, make it dashed up to the next existing x/y point.

Additionally, what plot type would you recommend for a plot with two Y points per X? The two points would be joined by a vertical line. The average of the two is the dual type line described above.

mailto:khobson@odot.org
Kenneth Ray Hobson, P.E.
Oklahoma DOT - QA & IAS Manager
200 N.E. 21st Street
Oklahoma City, OK 73105-3204
(405) 522-4985, (405) 522-0552 fax

Visit our website at:
http://www.okladot.state.ok.us/materials/materials.htm



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed May 25 07:30:47 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:01 EST