findScriptsByPattern: Find Scripts that contain a variable or depend on a package...

Description Usage Arguments Details Value

View source: R/findScripts.R

Description

Find scripts that have a pattern that you specify with a regular expression.

Usage

1
2
findScriptsByPattern(path = ".", filename_pattern = ".R$",
  recursive = FALSE, code_pattern)

Arguments

path

a character vector of full path names; the default corresponds to the working directory, getwd. Tilde expansion (see path.expand) is performed. Missing values will be ignored.

filename_pattern

a regular expression- default is '.R$'. Only file names which match the regular expression will be returned.

recursive

logical. Should the listing recurse into directories?

code_pattern

character vector of regular expressions (or simp;ly characters) to be matched against text in the script while scanning through scripts. If a character vector of length 2 or more is supplied, the first element is used with a warning.

Details

Scans scripts and finds which scripts have a sought pattern, E.G. 'x <- x^2'.
This function scans through scripts and will include obsolate scripts that do not run due to typos and bad syntax in its search.
This function will find a pattern such as 'x <- x^2', unlike findScriptsByPattern.

Value

A data.frame with four columns:
script - The name of the script containing the target,
linenum - The line number on which the target is found,
col - the number of characters into the line that the target can be found,
line - the target within its context


ivanliu1989/RQuant documentation built on Sept. 13, 2019, 11:53 a.m.