I'm trying to verify that the emails for a list are correct. I was thinking I could do a partial string match between Email and Name columns, and return a logical vector (TRUE/FALSE) in a new column.
In the example below, only rows 3 and 5 have correct emails, and the output would be 'TRUE' for these rows. I tried the following, and it hasn't worked:
>for (i in Test$LastName) {
Test$Match <- agrepl(i, Test$Email, ignore.case = TRUE)
}
>Test$Email %in% Test$LastName
Any other suggestions are welcome too. Thanks!

greplfunction could be helpfulTest$Emailto theagreplfunction, you're passing ALL the email addresses from your data frame.