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!
Tidyr
Changing data format
Summary
16. Exercise 5

Instruction

This dataset is in wide format. Let's change it to long format, and then we'll be done.

Exercise

Gather columns from 2001 to 2007 using gather().

Use year as the key and sale as the value.

Stuck? Here's a hint!

Type:

gather(car_sale, `2001`:`2007`, key = "year", value = "sale")