📅  最后修改于: 2022-03-11 14:56:26.155000             🧑  作者: Mango
df %>%
gather('a','b',key='whatever',value='whatever')
#df: the data frame you want to gather
#a and b: the columns of the old data frame that you want to turn into variables
#key: what to call the column of the new data frame that stores the variables
#value: what to call the column of the new data frame that stores the values