[Rd] capture "->"

Duncan Murdoch murdoch@dunc@n @end|ng |rom gm@||@com
Fri Mar 1 10:30:37 CET 2024


On 01/03/2024 4:17 a.m., Dmitri Popavenko wrote:
> Hi everyone,
> 
> I am aware this is a parser issue, but is there any possibility to capture
> the use of the inverse assignment operator into a formula?
> 
> Something like:
> 
>> foo <- function(x) substitute(x)
> 
> gives:
> 
>> foo(A -> B)
> B <- A
> 
> I wonder if there is any possibility whatsoever to signal the use of ->
> instead of <-

If you parse it with srcrefs, you could look at the source.  The parser 
doesn't record whether it was A -> B or B <- A anywhere else.

Duncan Murdoch



More information about the R-devel mailing list