Reputation: 13
I have a problem, I have this output in R:
[[155]]
[1] "@ju_kleeschulte" "@c"
[[156]]
[1] "@FDPFraktionNRW" "@c_lindner"
[[157]]
[1] "@HenningWerle" "@c_lindner" "@RTLWEST"
[[158]]
[1] "@Stefanswelt" "@fdp"
But I want to filter out the complete Values (156 & 157) with "@c_lindner" in it, because it is a retweet and I would like the tweets solely without that nametag in it. So, I would like the list to be with the values 155 & 158 for example. It should look like this:
[[155]]
[1] "@ju_kleeschulte" "@c"
[[156]]
[1] "@Stefanswelt" "@fdp"
Upvotes: 1
Views: 424
Reputation: 887028
We can place all the list
objects in a list
and then do the Filter
lapply(lstN, function(y) Filter(function(x) !any(x == "@c_lindner"), y))
lstN <- mget(paste0("lst", 1:10))
Upvotes: 1