I have a large framework containing a column of names, and given the nature of my data, the names are repeated. I also have a vector of a subset of those names that I need to exclude from this frame. Therefore, I want to determine the line number for each instance, which name in the data frame matches the name in the list of names to be deleted. Here is an example of what I'm trying to do ... but I can't get the code to work. Thanks!
a=c("tom", "bill", "sue", "jim", "tom", "amy") b=c(12,15,7,22,45,5) ab=data.frame(a,b) ab drop=which(ab$a==c("tom", "sue")) #only identifies those matching "tom" drop ab2=ab[-drop,] ab2
source share