Re: [R] is it safe to replace every "<-" by "=" in R code?

From: Peter Danenberg <>
Date: Mon, 14 Jan 2008 01:31:52 -0600

Quoth Mark Wardle on Prickle-Prickle, Chaos 14, 3174:
> I can see that f(b <- 10) is equivalent to f(assign("b"), 10))

f(assign("b", 10))?

My undestanding is that assign applies to the parental environment; but the return value of assign, namely 10, is passed to f as the local variable a.

The default value b = 4 then overrides the parental environment since it is unspecified in the call to f. mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Mon 14 Jan 2008 - 07:42:13 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 14 Jan 2008 - 08:30:06 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive