| contextFind | R Documentation |
Search R and Rmd Files for Matching Text, Get Context and Links
contextFind(
search_text,
path = ".",
recursive = TRUE,
contextLines = 2,
verbose = TRUE
)
search_text |
Text to search for |
path |
Root directory to search |
recursive |
Whether to recurse into subfolders |
contextLines |
Number of context lines around match |
verbose |
If TRUE (the default), prints the results to the console |
A list of lists, one for each match, with objects: file, match_line, mtime, and context. file is the file path in which the match was found, match_line is the line number for this particular match, mtime is a POSIXct datetime value indicating when the file was last modified, and context contains the number of lines before and after the found match (set by the contextLines parameter).
# Find custom functions in your codebase
contextFind("<- function")
# Get more context
contextFind("<- function", contextLines = 3)
# Explicitly set the search directory
contextFind("<- function", path = getwd())
# Exclude subdirectories
contextFind("<- function", recursive = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.