Save up to $499! Grab all Python courses for $49 or all online courses we’ve ever launched for only $169. Only Feb 11-16. Happy Valentine's!
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)