Session Ready
Exercise

Change the point size: numeric input

Numeric inputs have a few more arguments that text inputs do not have, such as min and max, which define the minimum and maximum numbers that can be chosen.

Note that when the value of an input is accessed in the server code, Shiny is smart enough to know what type of input was used, and therefore what type of object it should return. This means that if you have a numeric input with ID "foo", then input$foo will return a numeric value.

Instructions
100 XP

The code for the Shiny app from the last exercise is provided. Your task is to add a numeric input that the user can use to change the size of the points on the plot. Specifically:

  • Add a numeric input to the UI with ID "size", a label of "Point size", a default value of 1, and a minimum value of 1.
  • Add code to the server so that the numeric input will determine the point size in the plot (line 20).