get_calls_from_line: Gets function calls of interest in a "line" of R code.

Description Usage Arguments Value

Description

This function takes a line of R code (which should be of type 'language') and recursively processes the statements within that line, extracting those that are function calls. We exempt the built-in packages (except the package being evaluated, if it is a built-in package). Functions that are not found are namespaced with the "INVALID::" prefix.

Usage

1
2
get_calls_from_line(line, all_functions, package_name, function_name,
  argument_names, cache_this)

Arguments

line

A line of R code (type 'language')

all_functions

A vector of character strings listing every function in the package; used to check the current namespace

package_name

A character vector containing the name of the package

function_name

A character vector containing the name of the function being called.

argument_names

A vector of character strings containing the arguments of the current function; this is in case a function is passed through in the argument list.

cache_this

An environment, used to memoise the calls and keep track of functions defined inside this line.

Value

NULL or a vector of character strings containing the namespaced names of function calls.


aaronrudkin/werner documentation built on May 23, 2019, 6:03 a.m.