Suppose we do this:
f <- function(...) environment() e <- f(a = 1, b = 2) ls(e, all = TRUE)
[1] "..."
e$...
<...>
class(e$...)
[1] "..." Is there any way of getting a and b given e without modifying f?
3 messages · Gabor Grothendieck, Peter Dalgaard, Luke Tierney
Suppose we do this:
f <- function(...) environment() e <- f(a = 1, b = 2) ls(e, all = TRUE)
[1] "..."
e$...
<...>
class(e$...)
[1] "..." Is there any way of getting a and b given e without modifying f?
Suppose we do this:
f <- function(...) environment()
e <- f(a = 1, b = 2)
ls(e, all = TRUE)
[1] "..."
e$...
<...>
class(e$...)
[1] "..." Is there any way of getting a and b given e without modifying f?
> evalq(list(...),e) $a [1] 1 $b [1] 2
O__ ---- Peter Dalgaard ?ster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
Gabor Grothendieck wrote:
Suppose we do this:
f <- function(...) environment() e <- f(a = 1, b = 2) ls(e, all = TRUE)
[1] "..."
e$...
<...>
class(e$...)
[1] "..." Is there any way of getting a and b given e without modifying f? evalq(list(...),e)
$a [1] 1 $b [1] 2
I'm wondering though whether we should allow the internal DOTSXP value of "..." to escape to the user level. Might be more appropriate for get(e,"..."), e$... (and as.list.environment and maybe a few other things) to give the "Error: '...' used in an incorrect context" error if the value is a DOTSXP. luke
Luke Tierney
Chair, Statistics and Actuarial Science
Ralph E. Wareham Professor of Mathematical Sciences
University of Iowa Phone: 319-335-3386
Department of Statistics and Fax: 319-335-3017
Actuarial Science
241 Schaeffer Hall email: luke at stat.uiowa.edu
Iowa City, IA 52242 WWW: http://www.stat.uiowa.edu