Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(permute)
- set.seed(42)
- exampledf<- data.frame(allPerms(c(1,2,3,4)))
- exampledf<-head(exampledf)
- apply(exampledf,2,function(x){
- ll<-x[1]==1
- which(ll==T)
- })
- X1 X2 X3 X4
- 1 1 2 4 3
- 2 1 3 2 4
- 3 1 3 4 2
- 4 1 4 2 3
- 5 1 4 3 2
- 6 2 1 3 4
- X1
- X1
- X1
- X1
- X1
- X3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement