On Mon, Mar 9, 2009 at 8:55 AM, guangchuang yu
<guangchuan...@gmail.com> asked why switch(..., a <- 3, ...) doesn't
have the same effect as switch(..., a=3, ...).

In most contexts, `<-` and `=` are synonymous in R, and mean
assignment. In function-argument position, however, an infix `=` names
the argument.  Switch depends on the argument names.

            -s

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to