Duncan Murdoch wrote: > > Use <- for assignment, and = for function arguments. Then the > difference between > > f( a = 3 ) > f( a <- 3 ) > > is clear, and you won't be surprised that a gets changed in the second > case. If you use = for assignment, the two lines above will be > written as > > f( a = 3 ) > f( ( a = 3 ) ) > > and it is very easy to miss the crucial difference between them.
in fact, some recent posts show that things can go the other way round: people try to use <- for function arguments. i think the following is the most secure way if one really really has to do assignment in a function call: f({a=3}) and if one keeps this convention, <- can be dropped altogether. vQ ______________________________________________ R-help@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.