reshape2
Comparing gather (tidyr) to melt (reshape2)
Your gather line should look like: dat %>% gather(variable, date, -teacher, -pd) This says “Gather all variables except teacher and pd, calling the new key column ‘variable’ and the new value column ‘date’.” As an explanation, note the following from the help(gather) page: …: Specification of columns to gather. Use bare variable names. Select all … Read more