Hi.
I'm trying to identify values, if there are any, which contain more than one unique species of a particular BIN number. As you can see in my simplified code below, there are plenty of duplicate but in one case (BIN: BOLD:AAA2226) there are actually two different species attached to this BIN. I'm trying to filter, or select, those samples where one BIN number has more than 1 unique species, which again in this case would only be BOLD:AAA2226 (Pieris rapae and Pieris affinis).
Any suggestions how to solve that?
data.frame(
stringsAsFactors = FALSE,
BIN = c("BOLD:ACS5043","BOLD:ADJ8787",
"BOLD:ADJ8787","BOLD:ADJ8787","BOLD:ACA1612",
"BOLD:ACA1612","BOLD:AAA2226","BOLD:AAA2226","BOLD:AAA2226"),
Species = c("Zemeros flegyas",
"Dodona adonira","Dodona adonira","Dodona adonira",
"Prioneris thestylis","Prioneris thestylis","Pieris rapae",
"Pieris rapae","Pieris affinis")
)