Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Final quiz

Instruction

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

Exercise

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!

Type:

survey_long <- gather(
  survey,
  key = "category",
  value = "value",
  housing_fuel_power:communication,
  factor_key = TRUE)