From hb at maths.lth.se  Wed Mar 29 11:40:08 2006
From: hb at maths.lth.se (Henrik Bengtsson)
Date: Wed, 29 Mar 2006 11:40:08 +0200
Subject: [Rd] Substitute() changed since R2.3.0 (2006-02-02 r37243)?
Message-ID: <59d7961d0603290140y29d0b959w6fd6cc5a5a8dd24b@mail.gmail.com>

Hi,

I've got the following two versions of R on WinXP:

A) R Version 2.3.0 Under development (unstable) (2006-02-02 r37243)
B) R Version 2.3.0 Under development (unstable) (2006-03-27 r37579)

and a the following "test.R" script:

foo <- function(path, ...) { print(path) }
bar <- function(x, ...) foo(...)
wow <- function(x, ...) capture.output(foo(...))
bar(1, path=2)
print(wow(1, path=2))

With A, I get:

> source("test.R")
[1] 2
[1] "[1] 2"

But with B, I get
> source("test.R")
[1] 2
Error in print(path) : argument "path" is missing, with no default

Further debugging led me to the following test2.R script:

foo <- function(path, ...) { print(path) }
bar <- function(x, ...) foo(...)
wow <- function(x, ...) yaa(foo(...))
yaa <- function(...) substitute(list(...))
bar(1, path=2)
print(wow(1, path=2))

With A, I get

> source("test2.R")
[1] 2
list(foo(...))

But with B, I get

> source("test.R")
[1] 2
list(foo())

Note that '...' is missing in the latest version.  I don't think this is wanted.

/Henrik



[Rd] Substitute() changed since R2.3.0 (2006-02-02 r37243)?
Henrik Bengtsson