Skip to content

Instantly share code, notes, and snippets.

@akshat3096
Created May 12, 2019 11:33
Show Gist options
  • Save akshat3096/7bb34f6129ed1a9e8f06ae73d04b2c09 to your computer and use it in GitHub Desktop.
Save akshat3096/7bb34f6129ed1a9e8f06ae73d04b2c09 to your computer and use it in GitHub Desktop.
data<- data.frame(variable1 = rep(LETTERS[1:3], each = 3),
variable2 = rep(paste0("factor", c(1, 2, 3)), 3),
num = 1:9)
head(data)
spread(data,variable2,num)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment