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 4 Singapore Management University


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

Libraries to load for this classwork: tidyverse

Q1. What are the variables in the billboard data frame?


Q2. Billboard is not considered tidy data? Why?
Q3. Should we use pivot_wider() or pivot_longer() to convert the data to tidy data?
Q4. Use your chosen method in Q3 and convert the data to a tidy data. You are advised to google and
use the following options/functions to make your life easier.
• starts_with()  this will make it easier for you to input the columns
• values_drop_na  this will make your tidy data cleaner by converting explicit NA to
implicit NA
• names_prefix and names_transform  use this combo to convert your week from
char to int

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

You might also like