📜  r 中的收集函数 - 任何代码示例

📅  最后修改于: 2022-03-11 14:56:26.155000             🧑  作者: Mango

代码示例1
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