Skip to content

plot(1:10,c(1)$nothing) yields index plot (PR#482)

3 messages · Charles C. Berry, Thomas Lumley, Peter Dalgaard

#
<<insert bug report here>>

IMHO, 

	plot(x,c(1)$nothing)

should fail or at least issue a warning.

Instead it produces an index plot of the first argument, i.e. plot(x)

Chuck Berry

--please do not edit the information below--

Version:
 platform = sparc-sun-solaris2.7
 arch = sparc
 os = solaris2.7
 system = sparc, solaris2.7
 status = Patched
 major = 1
 minor = 0.0
 year = 2000
 month = February
 day = 29
 language = R

Search Path:
 .GlobalEnv, Autoloads, package:base
#
On Mon, 13 Mar 2000 cberry@tajo.ucsd.edu wrote:

            
No, the alternative is worse.

The ability to do plot(x) with x a vector is important.  One might think
that in 
	plot(x,y=NULL)
we could test for missing(y) rather than is.null(y) and issue a warning if
y was NULL but not missing.  More-or-less equivalently we could use
substitute(y) to check whether y was a literal NULL or an expression
evaluating to NULL.

This turns out to be a bad idea, because we must be able to call plot(x)
from other functions (with arbitrarily deep nesting), and it becomes very
messy to trick plot() into handling the arguments correctly as they are
passed from one function to another. 

Since plot(x) can't tell whether the NULL argument is deliberate or
accidental, it shouldn't try to guess and give a warning.


	-thomas

Thomas Lumley
Assistant Professor, Biostatistics
University of Washington, Seattle

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
Thomas Lumley <thomas@biostat.washington.edu> writes:
Actually, S-plus has that problem, not R:
[1] F

where R propagates missings just fine:
[1] TRUE

but given the amount of ported code we have to deal with, we probably
have to be able to deal with NULLs being passed to signify absent
arguments.