Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a = c("sample1", "asd")
- b = c("sample2" ,"poua")
- c = c("sample3", "asd")
- dat <- rbind(a,b,c)
- asd sample1 sample3
- poua sample2
- tapply(dat[,1], dat[,2], as.vector)
- $asd
- [1] "sample1" "sample3"
- $poua
- [1] "sample2"
- tapply(dat[,1], dat[,2], identity)
- $asd
- a c
- "sample1" "sample3"
- $poua
- b
- "sample2"
Add Comment
Please, Sign In to add comment