Description Usage Arguments Value Note Author(s) Examples
Grepping in a (my) R directory
1 2 3 4 |
str |
string to do grep for |
exclude |
string to exclude from grep |
x |
array of strings to check with |
value |
Boolean, third argument to |
opt |
options for ' |
dir |
name of root directory to do grep in |
pkg |
package name to do grep in; may be "" if |
split |
should |
lines |
a maximum of 'lines' lines will be returned |
out |
logical, should intermediate results be printed |
ggrep |
grep output, with line numbers and pertaining line, or "No file with given string found". |
grepnot |
grep output, combination of invert=FALSE and =TRUE. |
countChar |
count the individual (if split=TRUE) characters in |
ggrep, countChar
: both use system( grep ...)
The composed file string and the input string to grep are shown for checking.
length(ggrep())
shows number of found entries only.
If file denotes a directory,and no "r" is given, then
opt
: contains e.g.
- "c": count lines in same one file only,
- "i": ignores case,
- "n": give file and line number,
- "r": recurse below directory one level (only),
- "v": inverts matches,
- "w": complete word matches only,
- "x": matches must be whole lines only
ggrep("-v","xxx",exclude="") is the same as
ggrep(,"",exclude="xxx"), except that the former lacks line numbers.
Christian W. Hoffmann <christian@echoffmann.ch>
1 2 3 4 5 6 7 8 9 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.