Re: [Rd] Defining a method that behaves like '$'?

From: Duncan Murdoch <murdoch.duncan_at_gmail.com>
Date: Fri, 09 Jul 2010 08:29:57 -0400

On 09/07/2010 8:18 AM, Renaud Gaujoux wrote:
> Hi,
>
> is there a way to define a method say '$$' that would behave like '$'
> and allow calls like 'a$$name'?
No, the parser handles a fixed syntax, and that expression is not legal. You could do it with

a %$$% name

using the infix operator syntax. (I think the description in the R Language Definition suggests this is not legal, since $$ is not a valid name, but it does currently work and that's unlikely to change.)

Duncan Murdoch



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Fri 09 Jul 2010 - 12:36:59 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 09 Jul 2010 - 13:10:12 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive