Learn R Programming

ggiraph (version 0.3.1)

geom_boxplot_interactive: add boxplot with tooltips or click actions

Description

tooltips can be displayed when mouse is over boxplot, on click actions can be set with javascript instructions.

Usage

geom_boxplot_interactive(mapping = NULL, data = NULL, stat = "boxplot", position = "dodge", ..., outlier.colour = NULL, outlier.color = NULL, outlier.shape = 19, outlier.size = 1.5, outlier.stroke = 0.5, notch = FALSE, notchwidth = 0.5, varwidth = FALSE, na.rm = FALSE, show.legend = NA, inherit.aes = TRUE)

Arguments

mapping
The aesthetic mapping, see geom_point.
data
A data frame, see geom_point.
stat
see geom_boxplot.
position
Postion adjustment, see geom_point.
...
other arguments passed on to layer. See geom_point.
outlier.colour
see geom_boxplot.
outlier.color
see geom_boxplot.
outlier.shape
see geom_boxplot.
outlier.size
see geom_boxplot.
outlier.stroke
see geom_boxplot.
notch
see geom_boxplot.
notchwidth
see geom_boxplot.
varwidth
see geom_boxplot.
na.rm
show.legend
inherit.aes

See Also

ggiraph

Examples

Run this code
# add interactive boxplot -------
p <- ggplot(mpg,
  aes(x = class, y = hwy, tooltip = class)) +
  geom_boxplot_interactive()

ggiraph(code = print(p), width = .5)


p <- ggplot(mpg, aes(x = drv, y = hwy, tooltip = class, fill = class)) +
  geom_boxplot_interactive(outlier.colour = "red") +
  guides(fill = "none") + theme_minimal()

ggiraph(code = print(p), width = .5)

Run the code above in your browser using DataLab