Learn R Programming

ggiraph (version 0.6.1)

geom_point_interactive: interactive points

Description

The geometry is based on geom_point. See the documentation for those functions for more details.

Usage

geom_point_interactive(mapping = NULL, data = NULL,
  stat = "identity", position = "identity", 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

The statistical transformation to use on the data for this layer, as a string, see geom_point.

position

Postion adjustment, see geom_point.

na.rm
show.legend
inherit.aes
...

other arguments passed on to layer. See geom_point.

See Also

ggiraph

Examples

Run this code
# NOT RUN {
# add interactive points to a ggplot -------
library(ggplot2)

dataset <- structure(list(qsec = c(16.46, 17.02, 18.61, 19.44, 17.02, 20.22
), disp = c(160, 160, 108, 258, 360, 225), carname = c("Mazda RX4",
"Mazda RX4 Wag", "Datsun 710", "Hornet 4 Drive", "Hornet Sportabout",
"Valiant"), wt = c(2.62, 2.875, 2.32, 3.215, 3.44, 3.46)), row.names = c("Mazda RX4",
"Mazda RX4 Wag", "Datsun 710", "Hornet 4 Drive", "Hornet Sportabout",
"Valiant"), class = "data.frame")
dataset

# plots
gg_point = ggplot(
  data = dataset,
  mapping = aes(x = wt, y = qsec, color = disp,
                tooltip = carname, data_id = carname) ) +
	geom_point_interactive() + theme_minimal()

girafe(ggobj = gg_point)
# }

Run the code above in your browser using DataLab