[Rd] color NA is allowed, but "NA" is not ... (yet)

Martin Maechler Martin Maechler <maechler@stat.math.ethz.ch>
Tue, 10 Jul 2001 16:32:27 +0200

In several places, we have the convention that col =  NA  means
`` don't draw '', e.g. for points() or rect().

For col = <vector> this only works when the vector is integer (numeric),
but not in other cases.  I think this is a bug, even though not in the
strict sense, since we don't seem to claim it should work..


   plot(1:10, col = c(1:4,NA,NA,4:1))

## fine

   (cc <- heat.colors(4))
   plot(1:10, col = c(cc, NA,NA,rev(cc)))

## gives error :

Error in plot.xy(xy, type, col = col, pch = pch, cex = cex, bg = bg, lty = lty,  : 
	invalid color name


Does anybody see a problem in making  "NA" for character colors behave the
same as NA for integer (numeric) ones ?

Martin Maechler <maechler@stat.math.ethz.ch>	http://stat.ethz.ch/~maechler/
Seminar fuer Statistik, ETH-Zentrum  LEO D10	Leonhardstr. 27
ETH (Federal Inst. Technology)	8092 Zurich	SWITZERLAND
phone: x-41-1-632-3408		fax: ...-1228			<><
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