[R] list() assigning the same value to two items

Thaler, Thorn, LAUSANNE, Applied Mathematics Thorn.Thaler at rdls.nestle.com
Tue Jun 22 08:59:51 CEST 2010

> Try this variation of my.transform that I had posted here:
> http://tolstoy.newcastle.edu.au/R/e2/help/07/09/24707.html
> List <- function(..., L = list()) {
>        f <- function(){}
>        formals(f) <- eval(substitute(as.pairlist(c(alist(...), L))))
>        body(f) <- substitute(modifyList(L, list(...)))
>        f()
> }

Wow, this does the trick. Thanks a lot. Is this function part of any
package? Since I'd like to use it on a regular basis, it would be great
to have it packaged somewhere. If not, I could (provided you agree)
include it in a package I maintain. Thanks again.  

More information about the R-help mailing list