Skip to content

Instantly share code, notes, and snippets.

@TobCap
Created July 22, 2013 15:22
Show Gist options
  • Select an option

  • Save TobCap/6054709 to your computer and use it in GitHub Desktop.

Select an option

Save TobCap/6054709 to your computer and use it in GitHub Desktop.
If argument is quoted, returns itself. If not, this returns quoted variable.
as.quote <- function(.x){
expr.org <- eval(substitute(substitute(.x)), parent.frame())
if (any(c("quote", "as.name", "as.symbol") %in% all.names(expr.org))) .x
else expr.org
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment