Learn R Programming

polmineR (version 0.7.9)

tooltips: Add tooltips to html document.

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())

Arguments

.Object

a html or character object with html

tooltips

a named "list" of character vectors (length 1), 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

Examples

Run this code
# NOT RUN {
use("polmineR")
P <- partition("REUTERS", places = "argentina")
H <- html(P)
Y <- highlight(H, list(lightgreen = "higher"))
T <- tooltips(Y, list(lightgreen = "Further information"))
T

if (require("magrittr")){
  P %>%
    html() %>%
    highlight(list(yellow = c("barrels", "oil", "gas"))) %>%
    tooltips(list(yellow = "energy"))
}
# }

Run the code above in your browser using DataLab