[ESS] Small bug in R function argument tips

Martin Maechler maechler at stat.math.ethz.ch
Fri Feb 1 12:36:22 CET 2008


>>>>> "EI" == Erik Iverson <iverson at biostat.wisc.edu>
>>>>>     on Wed, 30 Jan 2008 13:22:51 -0600 writes:

    EI> Hello -
    EI> I get much use out of the R function argument tips now included in ESS, 
    EI> so thanks to those that worked on that.

    EI> I'm using ESS 5.3.6 with XEmacs 21.5 (Beta 24) on RHEL 4 (Linux), R 
    EI> version 2.6.1.

    EI> It appears that if a default argument value includes the "%" character, 
    EI> the function tips do not work correctly. To see this, try:

    EI> essTest <- function(x = "%")
    EI> {
    EI>    paste(100, x, sep = "")
    EI> }

    EI> and then do (in a .R buffer with ESS loaded and an R process running)

    EI> essTest(

    EI> The following is displayed in the minibuffer:

    EI> Syntax error: Invalid converter character, ?\"

    EI> There is another similar (probably related?) case.  This one will occur 
    EI> if there is a printf-style format specifier in the default argument list.

    EI> To see that error, try

    EI> essTest2 <- function(x = "%f")
    EI> {
    EI> paste(100, x, sep = "")
    EI> }

    EI> essTest2(

    EI> then gives in the minibuffer:

    EI> Wrong number of arguments: format, 0, "ARGS: x = \"%d\""

    EI> However, replacing %f by, say, %z (not a printf-style format specifier) 
    EI> in the above example would lead to an error message like the first.

    EI> I hope this is the right forum for reporting this.  It certainly does 
    EI> not affect me greatly, I just thought someone might like to know about 
    EI> it.

This was exactly the right forum.

Thank you very much, Erik, for reporting the problem!
I have been too busy the last days to look into this,
but we certainly will.

Thanks again!

Martin Maechler, ETH Zurich

    EI>   I originally found this by using the pdf function.

    EI> I also tested this on (regular) Emacs, and got the same error message in 
    EI> both cases, which was:

    EI> Not enough arguments for format string

    EI> Best,
    EI> Erik Iverson




More information about the ESS-help mailing list