Re: [R] lines() and recycled colours

From: michael watson (IAH-C) <>
Date: Tue 28 Feb 2006 - 20:37:46 EST


Lines behaves as the help() says it does:

lines(runif(11),runif(11),col=c("red","green"), type="h")


-----Original Message-----
[] On Behalf Of Robin Hankin Sent: 28 February 2006 09:31
To: RHelp
Subject: [R] lines() and recycled colours


?lines says

      For 'type = "h"', 'col' can be a vector and will be recycled as

Why doesn't lines() recycle colours for other types?

If I type

> plot(0:1,0:1,type="n")
> lines(runif(11),runif(11),col=c("red","green"))

then all ten lines are red, with no warning given. Is there a reason why colour recycling would be a bad idea in this case?   Also, it would be nice if arguments such as lwd were recycled if needed too.

Robin Hankin
Uncertainty Analyst
National Oceanography Centre, Southampton European Way, Southampton SO14
  tel  023-8059-7743

______________________________________________ mailing list
PLEASE do read the posting guide!

______________________________________________ mailing list
PLEASE do read the posting guide!
Received on Tue Feb 28 20:56:23 2006

This archive was generated by hypermail 2.1.8 : Tue 28 Feb 2006 - 21:08:48 EST