Session Ready
Exercise

Make the table interactive

Datatables from the DT package are often a better way to display data in a Shiny app when compared to the built-in tables. Shiny tables can be converted to datatables with two simple code modifications: instead of using tableOutput() and renderTable(), you use DT::dataTableOutput() and DT::renderDataTable(). Datatables have a wide variety of customization options, but we will not be using any special options.

Note that with the DT package, the convention is to not load the DT package, and instead use the DT:: prefix when calling the datatable functions.

Instructions
100 XP

The code for the Shiny app from the last coding exercise is provided without any modifications. Your task is to replace the basic Shiny table with a DT table. Specifically:

  • In the UI, replace the table output function with the DT datatable output (line 11).
  • In the server, replace the table rendering function with a DT datatable render funtion (line 31).