If I use
d <- function(x){deparse(substitute(x))}
for letters or number all works fine. d(a1)
gives "a1"
, for example. But using special characters results in an error. I want to use d(+)
and get "+"
as result.
From comments:
I want "+" == d(+)
to give a TRUE
. In other words, I do not want to use d(`+`). Is this possible? The function is part of a code that will await input from non-R-users and that is why I want to avoid using `` for special characters (I do not want explain to every user what a special character is).