cberry@tajo.ucsd.edu
2000-Mar-13 19:11 UTC
[Rd] plot(1:10,c(1)$nothing) yields index plot (PR#482)
<<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 -- Charles C. Berry (858) 534-2098 Dept of Family/Preventive Medicine E mailto:cberry@tajo.ucsd.edu UC San Diego http://hacuna.ucsd.edu/members/ccb.html La Jolla, San Diego 92093-0645 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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
2000-Mar-13 19:27 UTC
[Rd] plot(1:10,c(1)$nothing) yields index plot (PR#482)
On Mon, 13 Mar 2000 cberry@tajo.ucsd.edu wrote:> <<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)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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._