If you don't want to use quotes, you can use deparse(substitute())
trick which I found in the example section of ?substitute
:
is.defined <- function(sym) { sym <- deparse(substitute(sym)) env <- parent.frame() exists(sym, env)}is.defined(a)# FALSEa <- 10is.defined(a)# TRUE