findRscript {findR} | R Documentation |
Find R scripts by content with pattern matching
Description
findRscript
scans all directories and subdirectories of a given path for R scripts (.R) containing
a specific pattern. Hits can be copied to a new folder.
Usage
findRscript(pattern = "Hello World", path = ".", case.sensitive = TRUE,
comments = TRUE, show.results = TRUE, copy = FALSE,
folder = "findRscript", overwrite = TRUE)
Arguments
pattern |
a pattern (regular expression) to search for. |
path |
a character vector, path to be scanned. The default corresponds to the working directory, getwd(). |
case.sensitive |
a logical value. If |
comments |
a logical value. If |
show.results |
a logical value. If |
copy |
a logical value. If |
folder |
a character vector, path or name of new folder to copy matching R scripts to. |
overwrite |
a logical value. If |
Examples
# Find all Rscripts in the package folder that use the circlize package
findRscript(path = system.file(package = "findR"), pattern = "circlize")
# Save results in a data frame and show hits
dt <- findRscript(path = system.file(package = "findR"), pattern = "circlize", show.results = TRUE)
dt
[Package findR version 0.2.1 Index]