Plotly is good choice for this. If you already use ggplot2, it's quite easy to convert to plotly by using plotly::ggplotly(). Here is an example of creating a bar chart with ggplot and then turning it into an interactive chart. You can set custom text for the tooltip by using the text argument inside aes().
library(tidyverse)
library(plotly)
p <- mpg %>%
count(class, drv) %>%
ggplot() +
geom_col(
aes(
x = class, y = n, fill = drv,
text = paste0(
"Class: ", class, "<br>",
"Drive: ", drv, "<br>",
"Cars: ", n
)
)
)
ggplotly(p, tooltip = "text")