Exercise

Building your first dashboard

The data has been stored as a data frame called soccer. There are 3 predefined plots:

  • goals_plot: The number of goals scored by each team
  • yellow_plot, red_plot: The number of yellow/red cards given to each team

Some custom helper functions are used here:

  • daytime_fn(): Gets the day & time for a particular match
  • venue_fn(): Gets the venue for a particular match
  • grp_fn(): Gets the group of the matchup
  • team1_fn(), team2_fn(): The names of team 1/2
  • score1_fn(), score2_fn(): The number of goals scored by team 1/2

Instructions

100 XP
  • Fill in the blanks for the outputs in the first to third rows of the first tab/page.
  • Fill in the blanks for the plot outputs in the second page, which were called "goals", "yellow" and "red".
  • Place the UI and server together to render the shinydashboard.