I have two variables, a and b. I try to compute a-b using expression with the rlang package. quo(a-b) returns, as expected:
<quosure: global>
~a - b
However, I have a and b as strings. So I tried: quo(!!sym("a-b")), which results in
<quosure: global>
~`a-b` #(note the '')
So the question is why I obtain ~'a-b', and not ~a-b. How can I simply obtain ~a-b. Note that quo(!!sym("a")) returns, as expected:
<quosure: global>
~a
So it seems that there is an issue with the - sign (same will occur with *). Is it related to some special characters / non standard evaluation issues? How can I solve that?