I have a data.frame, where one column is a list (see this post) I would like to check which lists within the data.frame contain an element (let's say the number 3) Currently, I am looping through all rows of the data.frame.
df=data.frame(a=1:3,b=I(list(1,3:7,1:3)))
df
for(i in 1:nrow(df)){
print(3 %in% df$b[[i]])
}
Is there a more elegant way?