Note that in order for these plots to render properly in knitted RMarkdown documents, you have to actually load the plotly library in your code. Not doing it in this function itself because it's generally considered bad practice.

make_interactive(
  p = ggplot2:::last_plot(),
  tooltip = tooltip_default(),
  theme = theme_bw(),
  plus = NULL
)

Arguments

p

the ggplot to make interactive, by default the last plot

tooltip

vector of mouseover text to include (x, y, size, fill, text) and which order. By default, shows only "text" aesthetic if it is mapped, otherwise shows all.

theme

the theme to apply, theme_bw is the default

plus

additional ggplot items to add to the plot