getDepends: Get dependent input, output and data files for an R script.

View source: R/dependFuns.R

getDependsR Documentation

Get dependent input, output and data files for an R script.

Description

This function takes an R script, and identifies the files which are read (input and/or data) and written (output).

Usage

getDepends(file, info = as(readScript(file), "ScriptInfo"), fileFunctionNames = FileFunctionNames(), prev = info, loadPackages = TRUE, addExpressionNum = TRUE)

Arguments

file

An *.R file to analyze.

info

An object of class ScriptInfo, created by readScript() containing the script information.

fileFunctionNames

The names of functions which can read or write files. Default functions are provided by FileFunctionNames()

prev
loadPackages

logical, should the packages required by the script be loaded?

addExpressionNum

logical, should the expressions be numbered.

Value

Returns a data.frame consisting of,

filename

The name of the file which is being read/loaded or written/saved

operation

The operation being conducted on that file name

expressionNum

optional, if addExpressionNum = TRUE, adds the expression number

Author(s)

Duncan Temple Lang

See Also

getFilesRead getVariableDepends


duncantl/CodeAnalysis documentation built on April 28, 2024, 6:01 p.m.