= 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:
Dear R-users, I have written a short VB application to clean and format my R code. Everything works fine except one small issue that I did not expected; it is related the automatic replacement of assignment signs from "=" to "<-". Most functions or arguments seem to accept either = or <-, but some don't (e.g. ls(all=TRUE)). The result is that my supposedly clean codes do not run anymore :-( Is there a way to know the list of arguments/functions that do not accept "<-" signs ? Thanks in advance. Sebastien
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.