Learn R Programming

loon.ggplot (version 1.1.0)

itemLabel: Modify the itemLabel component

Description

Querying in interactive graphics

Usage

itemLabel(itemLabel = NULL, showItemLabels = NULL)

Arguments

itemLabel

The customized querying information.

showItemLabels

A logical value. Show item labels or not. Default is FALSE

Value

a ggproto object

See Also

linking, selecting, interactivity

Examples

Run this code
# NOT RUN {
if(interactive()) {

  l_ggplot(mpg, mapping = aes(x = displ, y = cty)) +
    geom_point(size = 4) +
    # push the states of scatter plot to the histogram
    itemLabel(itemLabel = with(mpg,
                 paste0("model: ", manufacturer, " ", model, "\n",
                 "year: ", year, "\n",
                 "drive way: ", drv, "\n",
                 "fuel type: ", fl)
              ),
              showItemLabels = TRUE
    )
    # hover the mouse on top of any point to check the information we set
}
# }

Run the code above in your browser using DataLab