scriptsearch: scriptsearch

Description Usage Arguments Value Examples

View source: R/scriptsearch.R

Description

Returns the number of times a searchterm appears in each file in a path (defaults to working directory).

Usage

1
2
3
4
5
6
7
scriptsearch(
  searchterms,
  dir = ".",
  rm = TRUE,
  filetypes = c("R", "Rmd"),
  escape = TRUE
)

Arguments

searchterms

String/ list of strings to search for.

dir

Path to the directory.

rm

Logical option for removing files with no hits from the output.

filetypes

String/list of strings to be recognised in file endings.

escape

Logical option for adding escape characters to special characters.

Value

Data frame containing the file paths, number of hits and search terms found in a directory.

Examples

1
2
3
4
5
scriptsearch("text")

scriptsearch("text", filetypes = "txt")

data <- scriptsearch("text", rm = FALSE)

carlos-r-git/scriptsearch documentation built on Sept. 1, 2020, 6:38 p.m.