You need to use the "%in%" operator instead of the "in" operator. If the specified item is present in the list, it will return TRUE, otherwise, FALSE.
Here is an example:
> a <- list("apple", "banana", "tea", "cow", "lotus", "tiger", "mango")> "tea" %in% a[1] TRUE> "coffee" %in% a[1] FALSE>