Suppose I've a data frame that look as following:
# Animal Food 2015 2016
Monkey Banana 54 65
Monkey Hotdog 43 76
## # ... with 54 more rows
And I would like to separate the Banana and Hotdog variable so the data frame looks like this:
# Animal Year Banana Hotdog
Monkey 2015 54 43
Monkey 2016 65 76
## # ... with 54 more rows
What function should I use in the tidyverse
package?