Created
July 22, 2013 15:22
-
-
Save TobCap/6054709 to your computer and use it in GitHub Desktop.
If argument is quoted, returns itself. If not, this returns quoted variable.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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