Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Mail <- c("xxx1@xxx.xx", "xxx2@xxx.xx", "xxx3@yyy.xx", "xxx4@zzz.xx")
- InterestingPublishers <- c("zzz.xx", "xxx.xx")
- Mail %in% InterestingPublishers
- FALSE FALSE FALSE FALSE
- grepl(InterestingPublishers, Mail)
- Warning message:
- In grepl(InterestingPublishers, Mail) :
- argument 'pattern' has length > 1 and only the first element will be used
- containsi <- integer()
- for (i in InterestingPublishers) {
- containsi <- c(containsi, grep(i, Mail))
- }
- Mail[containsi]
- [1] "xxx4@zzz.xx" "xxx1@xxx.xx" "xxx2@xxx.xx"
- Mail[unlist(lapply(InterestingPublishers, function(x) grep(x, Mail)))]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement