0% found this document useful (0 votes)
24 views1 page

Classwork 6

The document provides instructions for a classwork assignment involving data science with R. It asks students to generate static and dynamic graphs from baby name frequency data over time for several names, and to use a smoothing function to modify one of the graphs.

Uploaded by

CHAI TZE ANN
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views1 page

Classwork 6

The document provides instructions for a classwork assignment involving data science with R. It asks students to generate static and dynamic graphs from baby name frequency data over time for several names, and to use a smoothing function to modify one of the graphs.

Uploaded by

CHAI TZE ANN
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 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