[Rd] eval() bug in plot.formula() ?

Martin Maechler Martin Maechler <maechler@stat.math.ethz.ch>
Wed, 10 Jan 2001 18:11:19 +0100


I don't have time now to investigate myself,
and I'm not feeling like deciding myself if the following is a bug:

  myplot <- function(dat, cex = 1.2, ...) {
      if(!is.data.frame(dat <- as.data.frame(dat)))
	  stop("`dat' must be a data.frame")
      if(any(is.na(match(c("x","y"), names(dat)))))
	  stop("`dat' must have a `x' and a `y' component")
      plot(y ~ x, data= dat, cex=cex, ...)
  }

  dd <- list(x= 1:12, y = sin((1:12)/10))
  myplot(dd)
  ## Error in eval(expr, envir, enclos) : ... used in an incorrect context

  myplot(dd, col = "red") ## Works fine

  myplot(dd, cex=1)
  ## Error in eval(expr, envir, enclos) : ... used in an incorrect context

------------
The above code works fine in R 0.90  but fails already in 1.0.0

I believe it *is* a bug

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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._