stahel@stat.math.ethz.ch
2000-Aug-21 13:53 UTC
[Rd] symbols: xlim and ylim cannot be specified (PR#639)
symbols(iris[,1],iris[,2],rectangles=as.matrix(iris[,3:4]),inches=0.3, ylim=c(1,5)) Error in plot.default(NA, NA, type = "n", ylim = ylim, xlim = xlim, xlab = xlab, : formal argument "ylim" matched by multiple actual arguments Since plot is called inside symbols, with specified xlim and ylim, any specification through ,... hurts this call. I am pretty sure that you won't like to hear the suggestion that this error message formal argument "anything" matched by multiple actual arguments should only be a warning. I would find this more convenient since foreseeing these collisions and programming such arguments as explicit arguments of the "top" function is a nuisance when writing functions just for one project. Ceterum censeo: Thanks for your efforts for developing such a useful environment. Werner --please do not edit the information below-- Version: platform = i686-pc-linux-gnu arch = i686 os = linux-gnu system = i686, linux-gnu status major = 1 minor = 1.1 year = 2000 month = August day = 15 language = R Search Path: .GlobalEnv, d.complexity, package:SfS, Autoloads, package:base -- Werner Stahel ------------------ This message was sent by --------------------------------- Werner Stahel http://stat.ethz.ch/~stahel Seminar fuer Statistik phone : +41 1 632 34 30 ETH-Zentrum, LEO fax : +41 1 632 12 28 CH-8092 Zurich, Switzerland meet me: Leonhardstr. 27 ----------------------------------------------------------------------------- -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
stahel@stat.math.ethz.ch wrote:> > symbols(iris[,1],iris[,2],rectangles=as.matrix(iris[,3:4]),inches=0.3, > ylim=c(1,5)) > Error in plot.default(NA, NA, type = "n", ylim = ylim, xlim = xlim, xlab = xlab, : > formal argument "ylim" matched by multiple actual arguments > > Since plot is called inside symbols, with specified xlim and ylim, > any specification through ,... hurts this call. > > I am pretty sure that you won't like to hear the suggestion that > this error message > formal argument "anything" matched by multiple actual arguments > should only be a warning. > I would find this more convenient since foreseeing these collisions > and programming such arguments as explicit arguments of the "top" function > is a nuisance when writing functions just for one project. > > Ceterum censeo: Thanks for your efforts for developing such a useful > environment.Suggestion for a fix: function (x, y, circles, squares, rectangles, stars, thermometers, boxplots, inches = TRUE, add = FALSE, fg = 1, bg = NA, xlab = "", ylab = "", xlim = NULL, ylim = NULL, ...) ^^^^^^^^^^^^^^^^^^^^^^^^^ { ## [...] snip ## if (!add) { ### check, wheter xlim and ylim are already specified: if(is.null(xlim)) { xlim <- range(x, na.rm = TRUE) xlim <- xlim + c(-1, 1) * (0.1 * diff(xlim)) } if(is.null(ylim)) { ylim <- range(y, na.rm = TRUE) ylim <- ylim + c(-1, 1) * (0.1 * diff(ylim)) } plot(NA, NA, type = "n", ylim = ylim, xlim = xlim, xlab = xlab, ylab = ylab, ...) } .Internal(symbols(x, y, type, data, inches, bg, fg, ...)) } Regards, Uwe Ligges -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
maechler@stat.math.ethz.ch
2000-Aug-22 07:00 UTC
[Rd] symbols: xlim and ylim cannot be specified (PR#639)
>>>>> "Uwe" == Uwe Ligges <ligges@statistik.uni-dortmund.de> writes:Uwe> stahel@stat.math.ethz.ch wrote: >> >> symbols(iris[,1],iris[,2],rectangles=as.matrix(iris[,3:4]),inches=0.3, >> ylim=c(1,5)) >> Error in plot.default(NA, NA, type = "n", ylim = ylim, xlim = xlim, xlab = xlab, : >> formal argument "ylim" matched by multiple actual arguments >> >> Since plot is called inside symbols, with specified xlim and ylim, >> any specification through ,... hurts this call. yes, and Uwe's fix cures this problem. [Uwe, you should have CC'ed R-bugs, not (only) R-devel .. that's why I copy it again now]. and I have committed it for the release patches (!! i.e. "1.1.1 patched") >> I am pretty sure that you won't like to hear the suggestion that >> this error message >> formal argument "anything" matched by multiple actual arguments >> should only be a warning. >> I would find this more convenient since foreseeing these collisions >> and programming such arguments as explicit arguments of the "top" >> function is a nuisance when writing functions just for one project. Maybe this should be discussed a bit: The error can only be made into a warning when it makes sense to assume that it is always okay, to take the *LAST* actual argument as the desired one. This is the case probably whenever "..." comes at the end of the formal argument list -- which it is in about 95% of cases... Hmm, what do others think? >> Ceterum censeo: Thanks for your efforts for developing such a useful >> environment. Merci! Uwe> Suggestion for a fix: function (x, y, circles, squares, rectangles, stars, thermometers, boxplots, inches = TRUE, add = FALSE, fg = 1, bg = NA, xlab = "", ylab = "", xlim = NULL, ylim = NULL, ...) ^^^^^^^^^^^^^^^^^^^^^^^^^ { ## [...] snip ## if (!add) { ### check, wheter xlim and ylim are already specified: if(is.null(xlim)) { xlim <- range(x, na.rm = TRUE) xlim <- xlim + c(-1, 1) * (0.1 * diff(xlim)) } if(is.null(ylim)) { ylim <- range(y, na.rm = TRUE) ylim <- ylim + c(-1, 1) * (0.1 * diff(ylim)) } plot(NA, NA, type = "n", ylim = ylim, xlim = xlim, xlab = xlab, ylab = ylab, ...) } .Internal(symbols(x, y, type, data, inches, bg, fg, ...)) } Uwe> Regards, Uwe> Uwe Ligges Martin Maechler -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
ripley@stats.ox.ac.uk
2000-Aug-22 07:45 UTC
[Rd] symbols: xlim and ylim cannot be specified (PR#639)
On Tue, 22 Aug 2000 maechler@stat.math.ethz.ch wrote:> >>>>> "Uwe" == Uwe Ligges <ligges@statistik.uni-dortmund.de> writes: > > Uwe> stahel@stat.math.ethz.ch wrote: > >> > >> symbols(iris[,1],iris[,2],rectangles=as.matrix(iris[,3:4]),inches=0.3, > >> ylim=c(1,5)) > >> Error in plot.default(NA, NA, type = "n", ylim = ylim, xlim = xlim, xlab = xlab, : > >> formal argument "ylim" matched by multiple actual arguments > >> > >> Since plot is called inside symbols, with specified xlim and ylim, > >> any specification through ,... hurts this call. > yes, > and Uwe's fix cures this problem. > [Uwe, you should have CC'ed R-bugs, not (only) R-devel .. that's why I > copy it again now]. > > and I have committed it for the release patches (!! i.e. "1.1.1 patched")Why is using NULL preferable here? The standard paradigm as I understand it is ylab = "", xlim, ylim, ...) ... if(missing(xlim)) { xlim <- range(x, na.rm = TRUE) xlim <- xlim + c(-1, 1) * (0.1 * diff(xlim)) } In S there is a problem with passing down missingness, but not in R. Brian -- Brian D. Ripley, ripley@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Martin Maechler
2000-Aug-22 09:48 UTC
[Rd] symbols: xlim and ylim cannot be specified (PR#639)
[now I'm not CC'ing R-bugs, since this is not about the bug anymore..]>>>>> "BDR" == Prof Brian D Ripley <ripley@stats.ox.ac.uk> writes:BDR> On Tue, 22 Aug 2000 maechler@stat.math.ethz.ch wrote: ............. >> yes, >> and Uwe's fix cures this problem. >> and I have committed it for the release patches (!! i.e. "1.1.1 patched") which has ylab = "", xlim = NULL, ylim = NULL, ...) and later if(is.null(xlim)) { ... } BDR> Why is using NULL preferable here? The standard paradigm as I BDR> understand it is BDR> ylab = "", xlim, ylim, ...) BDR> ... BDR> if(missing(xlim)) { BDR> xlim <- range(x, na.rm = TRUE) BDR> xlim <- xlim + c(-1, 1) * (0.1 * diff(xlim)) BDR> } BDR> In S there is a problem with passing down missingness, but not in R. I know. Note however that to be really useful one would have to able to also *set* missingness for an argument (which I think we can't currently) I might want to call symbols(.very.long.argument.list.etc.etc., xlim = if(<something>) my.xlim else <<DEFAULT>>, ...) where with the NULL setup, I can even drop the else clause {since if(FALSE) evaluates to NULL}, but with the missing(xlim) paradigm, I should be able to set <<DEFAULT>> to missing... In short, we (Uwe, people here and me) *do* prefer NULL to missing... Martin -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._