Advertisement
Guest User

Untitled

a guest
Apr 30th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. library(permute)
  2. set.seed(42)
  3. exampledf<- data.frame(allPerms(c(1,2,3,4)))
  4. exampledf<-head(exampledf)
  5.  
  6. apply(exampledf,2,function(x){
  7. ll<-x[1]==1
  8. which(ll==T)
  9. })
  10.  
  11. X1 X2 X3 X4
  12. 1 1 2 4 3
  13. 2 1 3 2 4
  14. 3 1 3 4 2
  15. 4 1 4 2 3
  16. 5 1 4 3 2
  17. 6 2 1 3 4
  18.  
  19. X1
  20. X1
  21. X1
  22. X1
  23. X1
  24. X3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement