Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR R

gather function in r

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
 
PREVIOUS NEXT
Tagged: #gather #function
ADD COMMENT
Topic
Name
9+1 =