Black Lives Matter. Please consider donating to Black Girls Code today.

Add hyperlink to mapbox legend or hover text

Is it possible to add a hyperlink to a legend or to pop-up text with plot_mapbox?

Here’s an example of what I’m looking for, although the link is broken.

library(plotly)

Sys.setenv('MAPBOX_TOKEN' = 'your_mapbox_token_here')

dat <- map_data("world", "canada") %>% group_by(group)

p <- plot_mapbox(dat, x = ~long, y = ~lat,
  name = '<a href="https://facebook.com">This is a link</a>') %>%
  add_paths(size = I(2)) %>%
  add_segments(x = -100, xend = -50, y = 50, 75) %>%
  layout(mapbox = list(zoom = 0,
                       center = list(lat = ~median(lat),
                                     lon = ~median(long))
  ))
p