Session Ready
Exercise

Make your plot interactive

plotly is a popular package for creating interactive plots in Shiny. There are several other packages for interactive visualizations, but we will use plotly largely because of its function ggplotly(), which converts a ggplot2 plot into an interactive one.

Instructions
100 XP

The code for the Shiny app from the last exercise is provided. Your task is to replace the ggplot2 plot with a plotly plot. Specifically:

  • Load the plotly package.
  • Replace the plot output function with plotlyOutput (line 20).
  • Replace the plot render function with renderPlotly (line 29).
  • Convert the existing ggplot2 plot to a plotly plot (line 31).