Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- +--------+---------+
- | Fruit | Code |
- +--------+---------+
- | Apple | 1,2,3,4 |
- | Orange | 6,7 |
- | Banana | 10 |
- +--------+---------+
- fruitlist = list('Apple' = c(1,2,3,4),
- 'Orange' = c(6,7),
- 'Banana' = c(10)
- )
- > which(fruitlist==10)
- Error in which(fruitlist == 10) :
- (list) object cannot be coerced to type 'double'
- > which( 10 %in% fruitlist)
- [1] 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement