Skip to content
Prev 106450 / 398506 Next

call by reference

You can do this:


   fb <- function(bS, env = parent.frame()) {
        bS <- deparse(substitute(bS))
        assign(bS, 3, env = env)
   }
   fb(bS)
   bS
   rm(bS)
  # or corresponding to your code
  fb(bS, env = .GlobalEnv)

Of course when typed in both give the same result since the global environment
is the parent frame.

Please use <- and = consistently and properly space your source code.
On 12/21/06, biter bilen <biterbilen at yahoo.com> wrote: