tooltips-method | R Documentation |
Highlight tokens based on exact match, a regular expression or corpus
position in kwic
output or html document.
tooltips(.Object, tooltips, ...)
## S4 method for signature 'character'
tooltips(
.Object,
tooltips = list(),
fmt = "//span[@style=\"background-color:%s\"]",
verbose
)
## S4 method for signature 'html'
tooltips(.Object, tooltips = list(), fmt, verbose = TRUE)
## S4 method for signature 'kwic'
tooltips(.Object, tooltips, regex = FALSE, ...)
.Object |
A |
tooltips |
A named |
... |
Further arguments are interpreted as assignments of tooltips to tokens. |
fmt |
A format string with an xpath expression used to look up the node
where the tooltip is inserted. If missing, a heuristic evaluating the names
of the |
verbose |
A |
regex |
A |
use(pkg = "RcppCWB", corpus = "REUTERS")
a <- partition("REUTERS", places = "argentina")
b <- html(a)
c <- highlight(b, lightgreen = "higher")
d <- tooltips(c, list(lightgreen = "Further information"))
if (interactive()) d
# Using the tooltips-method in a pipe ...
h <- a %>%
html() %>%
highlight(yellow = c("barrels", "oil", "gas")) %>%
tooltips(list(yellow = "energy"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.