find_file_content | R Documentation |
Identify files within provided path that contain text that match a particular pattern.
find_file_content(
path,
file_pattern = NULL,
text_pattern,
recursive = FALSE,
locale = readr::default_locale(),
...
)
path |
File path that contains files of interest (can look into child folders using |
file_pattern |
Basic regular expression to pick up file name pattern (e.g. |
text_pattern |
Grab the n-th file from the list (descending order by date). Default set to |
recursive |
Reduce set of discovered file based upon a date threshold (default: |
locale |
Passed to |
... |
Additional parameters passed to |
This function is often useful to quickly scan folders containing code that you need to find a particular key-phrase.
Returns character vector for file names with matches
# Find pattern within set of files
find_file_content('./R', file_pattern = '\\.(R|Rmd)', text_pattern = 'sapply')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.