Guest User

Untitled

a guest
Jan 16th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. a = c("sample1", "asd")
  2. b = c("sample2" ,"poua")
  3. c = c("sample3", "asd")
  4.  
  5. dat <- rbind(a,b,c)
  6.  
  7. asd sample1 sample3
  8. poua sample2
  9.  
  10. tapply(dat[,1], dat[,2], as.vector)
  11.  
  12. $asd
  13. [1] "sample1" "sample3"
  14.  
  15. $poua
  16. [1] "sample2"
  17.  
  18. tapply(dat[,1], dat[,2], identity)
  19.  
  20. $asd
  21. a c
  22. "sample1" "sample3"
  23.  
  24. $poua
  25. b
  26. "sample2"
Add Comment
Please, Sign In to add comment