Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. +--------+---------+
  2. | Fruit | Code |
  3. +--------+---------+
  4. | Apple | 1,2,3,4 |
  5. | Orange | 6,7 |
  6. | Banana | 10 |
  7. +--------+---------+
  8.  
  9. fruitlist = list('Apple' = c(1,2,3,4),
  10. 'Orange' = c(6,7),
  11. 'Banana' = c(10)
  12.  
  13. )
  14.  
  15. > which(fruitlist==10)
  16. Error in which(fruitlist == 10) :
  17. (list) object cannot be coerced to type 'double'
  18.  
  19. > which( 10 %in% fruitlist)
  20. [1] 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement