Description Usage Arguments Value See Also Examples
View source: R/hierarchical_coverage_regex.R
The unique coverage of a text vector by a regex after partitioning out the elements matched by previous regexes.
1 2 3 4 5 6 7 8 |
text.var |
A text vector (vector of strings). |
term.list |
A list of named character vectors to match against |
ignore.case |
logical. Should case be ignored in matching the
|
sort |
logical. If |
verbose |
If |
... |
ignored. |
Returns a data.frame
with 7 columns:
the order in which the regex was searched for
the human readable name of the bound regex group
the unique prop coverage of the regex
the unique n coverage of the regex
the cumulative prop coverage of the regex
the cumulative n coverage of the regex
the bound (|) regex that corresponds to name
Other hierarchical_coverage functions:
hierarchical_coverage_term()
1 2 3 4 5 6 7 8 9 10 11 | regs <- setNames(
list(c('(?i)sam', "(?i)\\bam"), '^I', '(?i)(do|will) not', '(?i)(do|will)'),
c('am', 'I', "won't")
)
(out <- hierarchical_coverage_regex(sam_i_am, regs, ignore.case=FALSE))
summary(out)
plot(out)
plot(out, mark.one = TRUE)
# Use unnamed vectors for `term.list` too
hierarchical_coverage_regex(sam_i_am, unlist(regs, use.names = FALSE), ignore.case=FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.