Why doesn't gather() use the key variable name?
It's shameful, but I still can't wrap my mind fully around tidyr , specifically gather() . I feel like I'm missing something fundamental. If I run this tiny snippet of code library(tidyr) x <- data.frame(var1=letters[1:3], var2=LETTERS[7:9], var3=21:23) gather(x, foo, value) I get > x var1 var2 var3 1 a G 21 2 b H 22 3 c I 23 > gather(x, foo, value) variable value 1 var1 a 2 var1 b 3 var1 c 4 var2 G 5 var2 H 6 var2 I 7 var3 21 8 var3 22 9 var3 23 Where does foo get used? Is this completely unnecessary? Am I tripping up because I'm thinking reshape style where you define the ID variables and