hadley/ggplot2 — pull request #638 by wch (2012-08-02 22:07:08+00:00)
Title: geom_segment: remove cases where linetype is NA. Fixes #623

Fixes #623.

The code is essentially copied over from `geom_point`, except that `na.rm` is set to FALSE so it will always display the warning message; there's not the option to change it.

It also checks x, y, xend, yend, size, and shape for NA.

I also tried modifying `scale_linetype_discrete` so that it would use `na.value="01"`, hoping it would make a blank line, but grid apparently doesn't like zeros in the `lty`:

```
Error in grid.Call.graphics(L_segments, x$x0, x$y0, x$x1, x$y1, x$arrow) :
invalid line type: zeroes are not allowed
```