From macrakis at alum.mit.edu  Tue Mar 10 00:31:53 2009
From: macrakis at alum.mit.edu (Stavros Macrakis)
Date: Mon, 9 Mar 2009 19:31:53 -0400
Subject: [Rd] bug of *switch* function
In-Reply-To: <8cca69990903090746u7600e052l7244603c974616e6@mail.gmail.com>
References: <bc1181630903090655o1db1a397leb831a804c202761@mail.gmail.com>
	<e8e755250903090731g66ba567fq63c37810f7c9b8d@mail.gmail.com>
	<bc1181630903090735n4cafc4dak11c404394814ca4a@mail.gmail.com>
	<8cca69990903090746u7600e052l7244603c974616e6@mail.gmail.com>
Message-ID: <8b356f880903091631m4f287214k399aa99ad2dddecb@mail.gmail.com>

On Mon, Mar 9, 2009 at 8:55 AM, guangchuang yu
<guangchuangyu at 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



[Rd] bug of *switch* function
Stavros Macrakis