Session Ready
Exercise

Add an interactive table output

There are multiple htmlwidgets packages like DT, leaflet, plotly, etc. that provide highly interactive outputs and can be easily integrated into Shiny apps using almost the same pattern. For example, you can turn a static table in a Shiny app into an interactive table using the DT package:

  1. Create an interactive table using DT::datatable().
  2. Render it using DT::renderDT().
  3. Display it using DT::DTOutput().

In this exercise, you will update the app created previously, replacing the static table with an interactive table.

Instructions
100 XP
  • Create an interactive table output using DT with top 10 most popular names by sex and year. You can use the function top_10_names() to generate a data frame to display, and pass it to DT::datatable().
  • Display the table in the UI.