Re: [R] Vector lty argrument for lines or plot

From: Peter Dalgaard <>
Date: Fri, 21 Nov 2008 20:06:46 +0100

Brian Diggs wrote:
>Thank you for the suggestion, baptiste. segments() does do exactly what I was wanting and matplot()/matlines() is probably a better solution to what I was trying to do.
> However, I am still concerned about the discrepancy between the
documentation in ?par and the behavior of lines(). Should lines() be changed to cycle over a vector of lty (so that it agrees with the documentation in ?par)? Should the documentation of par be changed to use a different example of a function that cycles over a vector of lty (segments() being a good candidate)? Or are both lines() and ?par correct and there is a situation which lines() does cycle over a vector of lty that I (and at least baptiste as well) do not understand? The middle option is certainly the easiest, and I think the correct one, but I wanted to rule out the last one before filing a bug report.

The documentation for lines has

     'lwd' can be a vector: its first element will apply to lines but
     the whole vector to symbols (recycled as necessary).

which really is true, and you might expect something similar for lty, but lty does not apply to symbols. So the text in ?par is most likely a copy-paste blunder. In any case, this usage is somewhat far-fetched and a reference matplot() or segments() would, in both cases, express more clearly what ?par is trying to say.

   O__  ---- Peter Dalgaard             Ă˜ster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
~~~~~~~~~~ - (              FAX: (+45) 35327907

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Fri 21 Nov 2008 - 19:08:52 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 21 Nov 2008 - 19:31:23 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive