search_code: Find a Pattern in an .R Code File

Description Usage Arguments Value Examples

View source: R/misc_tools.R

Description

Reads in a .R code file by line and searches for a given pattern.

Usage

1
search_code(.file, pattern, quiet = TRUE, ...)

Arguments

.file

character. The file to read in and search.

pattern

character. A pattern to pass to grep, in RegExp format.

quiet

logical. Should a warning be thrown if the pattern is not in the file?

...

pass through additional options

Value

a data frame containing the line number and line text where the pattern was found in the file.

Examples

1
2
3
4
## Not run: 
    search_code("./R/misc_toolr.R", "export")

## End(Not run)

burch-cm/kittius documentation built on March 11, 2021, 5:40 a.m.