find.forbidden.calls: Returns a list of forbidden calls

Description Usage Arguments Examples

View source: R/whitelist.r

Description

Returns a list of all subcalls of call that are forbidden given the provided whitelists and blacklists. Usually, it suffices to simply call check.whitelist. This function is slower, put may be helpful if the exact sources of the violations want to be known.

Usage

1
2
3
find.forbidden.calls(call, wl.funs = NULL, wl.vars = NULL,
  wl.calls = NULL, bl.funs = NULL, bl.vars = NULL,
  check.white.list.res = NULL)

Arguments

call

the call object

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 named list of quoted calls that are allowed. The list names should be the call names, i.e. call[[1]]. 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=library(dplyr)).

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.

check.white.list.res

optional the returned object of a call to check.white.list. Can speed up find.forbidden.calls

Examples

1
2
3
4
5
6
7
8
## Not run: 
  call = quote({
    print(abs(-2*5*log(abs(-1))))
  })
  find.forbidden.calls(call, bl.funs=c("abs"), wl.calls = alist(abs=abs(-1)))


## End(Not run)

skranz/whitelistcalls documentation built on May 30, 2019, 3:04 a.m.