Skip to content

variable scope

1 message · David Brahm

#
VBMorozov at lbl.gov wrote:
Just in case the ensuing discussion got too esoteric, here's one simple answer:

R> x <- 1:10
R> MyFunc <- function(x, zz) assign(deparse(substitute(zz)), sum(x), 1)
R> MyFunc(x,y)
R> y
   [1] 55