This document contains instructions for a classwork assignment on data wrangling in R. It asks students to load tidyverse libraries, identify the variables in a billboard data frame, explain why the data is not tidy, choose whether to use pivot_wider or pivot_longer to convert it to tidy format, and use specified options to clean the converted data. The assignment aims to have students practice converting data to tidy format in R.
This document contains instructions for a classwork assignment on data wrangling in R. It asks students to load tidyverse libraries, identify the variables in a billboard data frame, explain why the data is not tidy, choose whether to use pivot_wider or pivot_longer to convert it to tidy format, and use specified options to clean the converted data. The assignment aims to have students practice converting data to tidy format in R.
This document contains instructions for a classwork assignment on data wrangling in R. It asks students to load tidyverse libraries, identify the variables in a billboard data frame, explain why the data is not tidy, choose whether to use pivot_wider or pivot_longer to convert it to tidy format, and use specified options to clean the converted data. The assignment aims to have students practice converting data to tidy format in R.
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).