我尝试检查列表booster_word中是否包含列表var2中的至少一个元素。为此,我使用:
any(var2 %in% booster_word)
但这是不正确的。
示例:
> var2
[[1]]
[1] "served" "both" "as"
> booster_word
[1] "more" "very" "too" "much" "completely" "absolutely" "fully" "totally" "definitely" "extremely"
[11] "often" "frequently" "enough" "a lot" "as"
> any(var2 %in% booster_word)
[1] FALSE
请问好吗?
谢谢
答案 0 :(得分:1)
我们可以将list
转换为vector
[[
,因为它是length
1。
any(var2[[1]] %in% booster_word)