Currently if I want to show data in a table in R I can hyperlink text via markdown, html href, or LaTeX href. This is often nice for giving access to more info about a particular element w/o cluttering the table.
How is it possible to give the same kinds of hyperlinked text in a visualization made with ggplot2?
So for example if I make this plot:
With the code below, how can I make the axis text hyperlink to the wikipedia pages that correspond?
library(tidyverse)
mtcars %>%
rownames_to_column('car') %>%
slice(5:8) %>%
mutate(
link = c(
'https://de.wikipedia.org/wiki/AMC_Hornet',
'https://en.wikipedia.org/wiki/Plymouth_Valiant',
'https://en.wikipedia.org/wiki/Plymouth_Duster',
'https://en.wikipedia.org/wiki/Mercedes-Benz_W123'
)
) %>%
ggplot(aes(x = mpg, y = car)) +
geom_point(size = 2)
@user20650 Here is a 'gridSVG' solution:
Here is one option that I used.
Your example:
And then:
If you open
tf2
in your browser: