line plot with NA

Martin Maechler Martin Maechler <maechler@stat.math.ethz.ch>
Thu, 2 Apr 1998 20:20:38 +0200


>>>>> "tony" == Anthony Rossini <rossini@math.sc.edu> writes:

>>>>> "Bill" == Bill Simpson <wsimpson@uwinnipeg.ca> writes:

    Bill> (See why I am using NA? I can work around this problem by using
    Bill> intensityan and intensitycb)

    Bill> Now do a plot of peakan: plot(intensity, peakan, pch=10,type="b")

    Bill> The plot skips the point (260000,NA), but no line beyond
    Bill> x=260,000.

    Bill> I think the behaviour should be to draw a line between
    Bill> (180000,7.4) and (310000,8.4).

    tony> I respectfully disagree.  If the data were in fact longitudinal
    tony> data, with missing observations, one valid scenario would be to
    tony> halt, which is what is happening.

I'm with Tony (and the  S(-plus) developers are, too).
Bill, note that the current behavior is really the desired one
in typical time-series situations with missing values:
The missing values *are* graphically missing, 
which you would really want, especially in exploratory sitatuations.
((we had quite a few data analysis projects with enviromental data over
  time, where it was important to visualize the "measurement gaps")).

    tony> Maybe a na.omit flag would be appropriate for plot?  (is there
    tony> one?  I'm just speculating, not having easy access to R or Splus
    tony> today).

There's none, currently (neither R nor S-plus).

In R ( version >= 0.62 ,  == UNSTABLE)
you could use

	 plot(peakan ~ intens, subset = !is.na(peakan), pch=10,type="b")

to get the result you want.

Martin
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._