whitelist.eval: Only evaluate expr if it passes check.whitelist

Description Usage Arguments Value

View source: R/whitelist.r

Description

if the expression is not cleared by check.whitelist throw an error

Usage

1
2
3
whitelist.eval(expr, envir = parent.frame(), enclos = if (is.list(envir) ||
  is.pairlist(envir)) parent.frame() else baseenv(), wl.funs = NULL,
  wl.vars = NULL, wl.calls = NULL, bl.funs = NULL, bl.vars = NULL)

Arguments

expr

an R call object that shall be evaluated

envir

the environment in which expr shall be evaluated

enclos

see help for 'eval'

wl.funs

a character vector of the function names that are allowed (whitelisted). If NULL ignored.

wl.vars

a character vector of the variable names that are allowed (whitelisted). If NULL ignored.

wl.calls

a list of explicit calls that are allowed. For example, one may not generally whitelist the function 'library' (who knows what can happen if a library has functions with the same name than some whitelisted function but different behavior) Yet one may allow the explicit call 'library(dplyr)'. In this case, we could set wl.calls = alist(library(dplyr)). DOES NOT YET WORK!

bl.funs

a character vector of the function names that are forbidden (blacklisted). If NULL ignored.

bl.vars

a character vector of the variable names that are forbidden (blacklisted). If NULL ignored.

Value

the evaluated expr if it passes check.whitelist, otherwise an error.


skranz/WhitelistEval documentation built on May 30, 2019, 2:02 a.m.