findRmd: Find R Markdown files by content with pattern matching

Description Usage Arguments Examples

Description

findRmd scans all directories and subdirectories of a given path for R Markdown files (.Rmd) containing a specific pattern. Hits can be copied to a new folder.

Usage

1
2
3
findRmd(path = ".", pattern = "Hello World", case.sensitive = TRUE,
  show.results = TRUE, copy = FALSE, folder = "findRmd",
  overwrite = TRUE)

Arguments

path

a character vector, path to be scanned. The default corresponds to the working directory, getwd().

pattern

a pattern (regular expression) to search for.

case.sensitive

a logical value. If TRUE, pattern-matching is case-sensitive.

show.results

a logical value. If TRUE, results are printed after completion.

copy

a logical value. If TRUE, all matching R Markdown files are copied to folder.

folder

a character vector, path or name of new folder to copy matching R Markdown files to.

overwrite

a logical value. If TRUE, existing destination files are overwritten.

Examples

1
2
3
4
5
6
# Find all R Markdown files in the package folder that contain a ggplot bar chart
findRmd(path = system.file(package = "findR"), pattern = "geom_bar")

# Save results in a data frame and show hits
dt <- findRmd(path = system.file(package = "findR"), pattern = "geom_bar", show.results = TRUE)
dt

findR documentation built on May 2, 2019, 12:38 p.m.

Related to findRmd in findR...