getExpressionThread {CodeDepends}R Documentation

Find the sequence of expressions needed to get to a certain point in the code

Description

What's the difference between this and getVariableInputs, getVariableDepends, getSectionDepends?

This does not currently attempt to get the minimal subset of expressions within the code block. In other words, if there are extraneous expressions within these blocks that are not actually necessary, these are evaluated. This is important for expressions with side effects, e.g. writing files or generating plots.

Usage

getExpressionThread(target, expressions, info = lapply(expressions,
getInputs, ...), ...)

Arguments

target

either the index of the expression of interest in expressions or the names of the variables.

expressions

the list of expressions

info

a list of objects giving information about the inputs to each top-level expression in expressions.

...

Passed to getInputs if info is not explicitly specified.

Value

A Script-class object containing the subset of the code chunks pertinent to the target variable(s).

Author(s)

Duncan Temple Lang

See Also

getDependsThread

Examples

 e = readScript(system.file("samples", "dual.R", package = "CodeDepends"))
 getExpressionThread("fit", e)

 getExpressionThread("y", e)
 getExpressionThread("x", e)

 getExpressionThread("k", e)

  # With several
 s = readScript(system.file("samples", "sitepairs.R", package = "CodeDepends"))
 o = getExpressionThread("covs", s)

[Package CodeDepends version 0.6.5 Index]