Define an expression
> xy <- expr(x+y)
Use it to build a second expression ... and it works
> expr(a + !!xy)
a + (x + y)
simply changing the order of the arguments and it stops working
> expr(!!xy + a)
Error in (function (x) : object 'a' not found
Am I missing something?
Thanks
There is way to make it work. Change the way
!!xy
has been used inexpr
and it will work. i.eThe reason is that priority of all arithmetic and comparison operators are higher than
!
. Hence arithmetic and comparison operators binds tightly than!
. e.g.:The r-documentation for
quasiquotation
has clearly mentioned it as: