Skip to content
Prev 145881 / 398500 Next

= or <-

No function accepts <- in place of =.  In the first
of the 4 examples below we are simply setting
variable b to 10 and then passing it to f as its
first argument. f(b = 10) would be different since
that specifies that we want argument b to take
on the value of 10.

f <- function(a=1, b=2) a-b

# these 5 lines below all give the same result
# except the first 3 also have the side effect
# of creating a variable b
f(b <- 10)
b <- 10; f(b)
f(a = b <- 10)
f(10)
f(a=10)
On Mon, Jun 2, 2008 at 10:05 AM, S?bastien <pomchip at free.fr> wrote: