Only this week, get the SQL Complete Track of 9 courses in a special prize of $330 $89!
Final quiz


As you can see, our data is in wide format. We need our data to be in long format.


Change the format of our survey data to long. Assign the result to a new variable named survey_long. Name the new columns category and value. Note: we are changing columns from housing_fuel_power to communication. To create a key value as a factor, we add the argument factor_key = TRUE.

Stuck? Here's a hint!


survey_long <- gather(
  key = "category",
  value = "value",
  factor_key = TRUE)