Identify which objects of list are contained (subset of) in another list in R
问题 Thank you for your kind reply to my previous questions. I have two lists: list1 and list2. I would like to know if each object of list1 is contained in each object of list2. For example: > list1 [[1]] [1] 1 [[2]] [1] 2 [[3]] [1] 3 > list2 [[1]] [1] 1 2 3 [[2]] [1] 2 3 [[3]] [1] 2 3 Here are my questions: 1.) How do you I ask R to check if an object is a subset of another object in a list? For instance I would like to check if list2[[3]]={2,3} is contained in (subset of) list1[[2]]={2} . When