Search
 
SCRIPT & CODE EXAMPLE
 

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
Comment

PREVIOUS NEXT
Code Example
R :: r make directory 
R :: repeat each value in a vector in r 
R :: r append to vector 
R :: r convert to factor 
R :: R darekn color 
R :: string concatination R 
R :: How to use par() in R 
R :: how many pairwise combinations 
R :: Derive end of the week date in r 
R :: finding index of element in r 
R :: how to randomly select R 
R :: r remove spaces in column names 
R :: remove name of a column 
R :: how to rename variables in r dplyr 
R :: barplot_spacewidth 
R :: alpha 2 codes in r 
R :: R difference | and || 
R :: index in r 
R :: combine scripts into a pipeline 
R :: square root calculation r 
Rust :: rustlang error: linker `link.exe` not found 
Rust :: create file rust 
Rust :: range in rust 
Rust :: rust square root 
Rust :: rust variables in println 
Rust :: rust get char at index 
Rust :: armanriazi•rust•interior-mutability•vs•inherited-mutability 
Rust :: armanriazi•rust•error•[E0614]: cannot be dereferenced 
Rust :: armanriazi•rust•mem•doublefree 
Rust :: rust•armanriazi•capacity•reserve 
ADD CONTENT
Topic
Content
Source link
Name
9+9 =