[R] bug or no?

Sundar Dorai-Raj sundar.dorai-raj at PDF.COM
Tue Aug 24 20:56:59 CEST 2004



Richard Morey wrote:

> The following code prints [1] 2, as it should
> 
> temp<-function(ab,...){
> print(ab)
> }
> temp(2,s=3)
> 
> However, this code prints [1] 3:
> 
> temp<-function(sb,...){
> print(sb)
> }
> temp(2,s=3)
> 
> It should still print [1] 2. It appears
> that if a variable in ... begins with the same letter as another variable,
> the value in the variable in ... overwrites the value in the variable with
> the same first letter.
> 
> I didn't see this bug reported elsewhere.
> 
> Richard Morey
> 
> Is this a bug or am I missing something?
> 

You are missing something. Mainly, reading section 4.3 of "R Language 
Definition", which should come with your distribution or is accessible 
from CRAN.

http://cran.r-project.org/doc/manuals/R-lang.pdf

--sundar




More information about the R-help mailing list