Exercise

Add a table output

In order to add any output to a Shiny app, you need to:

  1. Create the output (plot, table, text, etc.).
  2. Render the output object using the appropriate render___ function.
  3. Assign the rendered object to output$x.
  4. Add the output to the UI using the appropriate ___Output function.

In this exercise, you will add a table output to the baby names explorer app you created earlier. Don't forget that code inside a render___ function needs to be wrapped inside curly braces (e.g. renderPlot({...})).

Instructions

100 XP
  • Create a table output named table_top_10_names, 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.
  • Display the table in the UI.