ngrep | R Documentation |
It is not simple to negate a regular expression. This obviates the need
takes the long way round: negating the corresponding grepl
call.
ngrep(pattern, x, value = FALSE, ...)
x, value, pattern |
As in |
... |
Arguments passed to |
If value
is FALSE
(the default), indices of x
which do not match the
pattern; if TRUE
, the values of x
themselves.
grep("[a-h]", letters) ngrep("[a-h]", letters) txt <- c("The", "licenses", "for", "most", "software", "are", "designed", "to", "take", "away", "your", "freedom", "to", "share", "and", "change", "it.", "", "By", "contrast,", "the", "GNU", "General", "Public", "License", "is", "intended", "to", "guarantee", "your", "freedom", "to", "share", "and", "change", "free", "software", "--", "to", "make", "sure", "the", "software", "is", "free", "for", "all", "its", "users") grep("[gu]", txt, value = TRUE) ngrep("[gu]", txt, value = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.