library(ggplot2)
library(ggiraph)
iris$id <- seq(nrow(iris))
sps <- as.character(unique(iris$Species))
names(sps) <- sps
p <- ggplot(iris, aes(x=Sepal.Length,
y=Sepal.Width,
fill = Species,
starshape = Species,
tooltip = Species,
data_id = id
)
) +
geom_star_interactive(size=2.5, alpha=.8) +
scale_starshape_manual_interactive(
values = c(1, 12, 15),
tooltip = sps,
data_id = sps,
)
girafe(ggobj=p)
Run the code above in your browser using DataLab