grep.VIgraph | R Documentation |
Allows the output from VI.ggplot to be searched and replaced based on a search pattern.
## S3 method for class 'VIgraph'
grep(pattern, x, ...)
## S3 method for class 'VIgraph'
gsub(pattern, replacement, x, ...)
pattern |
Regular expression for matching, as per |
replacement |
Replacement text, as per |
x |
object returned by |
... |
other arguments passed on to |
The BrailleR package redefines the grep
and gsub
functions as
generic functions (that dispatch on the x
argument),
with base::grep
and base::gsub
as the default methods.
This grep.VIgraph
method behaves like base::grep
with value=TRUE
(i.e., it returns the matched values, not the indices).
Returns a new object of the same type as that returned by VI.ggplot, but with the text component restricted to only those lines that matched the pattern or with the text component replaced.
Debra Warren and Paul Murrell
if (require(ggplot2)) {
grep("axis", VI(qplot(1,1)))
gsub("labels", "tick labels", VI(qplot(1,1)))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.