Skip to content

Commit

Permalink
new function to evaluate symbols/languages for #142
Browse files Browse the repository at this point in the history
  • Loading branch information
yihui committed Feb 25, 2012
1 parent fe746de commit 3eb0514
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,12 @@ eval_opt = function(x) {
eval(parse(text = x), envir = globalenv())
}

## eval options as symbol/language objects
eval_lang = function(x, envir = globalenv()) {
if (!is.symbol(x) && !is.language(x)) return(x)
eval(x, envir = envir)
}

## counterpart of isTRUE()
isFALSE = function(x) identical(x, FALSE)

Expand Down

0 comments on commit 3eb0514

Please sign in to comment.