Learn R Programming

polmineR (version 0.8.8)

tooltips: Add tooltips to text output.

Description

Highlight tokens based on exact match, a regular expression or corpus position in kwic output or html document.

Usage

tooltips(.Object, tooltips, ...)

# S4 method for character tooltips(.Object, tooltips = list())

# S4 method for html tooltips(.Object, tooltips = list())

# S4 method for kwic tooltips(.Object, tooltips, regex = FALSE, ...)

Arguments

.Object

A html or character object with html.

tooltips

A named list of character vectors, the names need to match colors in the list provided to param highlight. The value of the character vector is the tooltip to be displayed.

...

Further arguments are interpreted as assignments of tooltips to tokens.

regex

A logical value, whether character vector values of argument tooltips are interpreted as regular expressions.

Examples

Run this code
use(pkg = "RcppCWB", corpus = "REUTERS")

P <- partition("REUTERS", places = "argentina")
H <- html(P)
Y <- highlight(H, lightgreen = "higher")
T <- tooltips(Y, list(lightgreen = "Further information"))
if (interactive()) T

# Using the tooltips-method in a pipe ...
h <- P %>%
  html() %>%
  highlight(yellow = c("barrels", "oil", "gas")) %>%
  tooltips(list(yellow = "energy"))

Run the code above in your browser using DataLab