Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

DSA212 Data Science with R School of Economics

Classwork 6 Singapore Management University


Dr. Jing Rong GOH
Solutions should be written in Rmd.

Libraries to load for this classwork: tidyverse, babynames, and shiny

Q1. Generate a static graph (similar to Lecture 6 Figure 2) of the frequencies (i.e. the count) of the
following names over time:
• Adolf, Aristotle, Chucky, Galileo, Siri, Elon,
• No need to differentiate between Male vs Female,
• Comment on the chart, which is the most striking line?
Q2. Using the shiny package, convert the static plot above to a dynamic plot, with the following
features:
• a check box option that allows you to select the plot to display
• default names to be Adolf and Chucky
• Provide appropriate title, and axis labels
Q3. The plot in Q2 is very “spiky”, let’s use the geom_smooth() function instead, with the following
features:
• method = “loess”
• se = “FALSE”
• span = 0.5

Strictly confidential – Do not distribute without prior permission from the author(s).

You might also like