findlines | R Documentation |
Works like grep or which for a bunch of files (line by line). Useful example: 1. Always use the same predefined word(s) to mark positions in scripts where you should review something at some time (e.g. 'TODO'). 2. Search for those words within a bunch of files to get an overview.
findlines(
expression = "# magic word",
exclusive = FALSE,
path = ".",
filepattern = "\\.R$|\\.Rmd$",
recursive = TRUE
)
expression |
Character. Specify expression to match the line. |
exclusive |
Logical. If TRUE use which, else grep. |
path |
Character. Specify path to the directory including the files. |
filepattern |
Character. Specify file pattern. |
recursive |
Logical. |
If exclusive == FALSE you can use regular expressions (and therefore multiple expressions at a time).
Frederik Sachser
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.