Created
February 11, 2022 16:08
-
-
Save geotheory/03eeb4d76c7440d24f4d0ffdc4960ff3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(ggplot2) | |
library(ggiraph) | |
data <- mtcars | |
data$carname <- row.names(data) | |
gg_point = ggplot(data = data) + | |
geom_point_interactive(aes(x = wt, y = qsec, color = disp, | |
tooltip = carname, data_id = carname)) + | |
theme_minimal() | |
g = girafe(ggobj = gg_point) | |
g$x$html = stringr::str_replace(g$x$html, fixed('<svg '), '<svg alt="A scatterplot of mtcars, plotting wt against qsec. The graph suggests a low correlation between two normally-distributed variables" ') | |
g |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment