Hi
I want to write a code that compares column "Currentid" with "Matchid" to see if there's a perfect match (i.e., the "Matchp' is equal to 100.0), and if that is not the case, I still want the code to say that it is a perfect match (i.e., TRUE) if the number of correct matches are larger than the number of incorrect matches.
As you can see in my data below, there are perfect matches for all rows except 9. So the code should report a "TRUE" value . But if there were equal amounts of correct and incorrect matches, it should report false.
data.frame(
stringsAsFactors = FALSE,
Sampleid = c("AVM_360","AVM_360","AVM_360",
"AVM_360","AVM_360","AVM_360","AVM_360","AVM_360",
"AVM_360"),
Currentid = c("Bibasis vasutana",
"Bibasis vasutana","Bibasis vasutana","Bibasis vasutana",
"Bibasis vasutana","Bibasis vasutana","Bibasis vasutana",
"Bibasis vasutana","Bibasis vasutana"),
Matchp = c("100.0","100.0","100.0",
"100.0","100.0","100.0","100.0","100.0","100.0"),
Matchid = c("Bibasis vasutana",
"Bibasis vasutana","Bibasis vasutana","Bibasis vasutana",
"Bibasis vasutana","Bibasis vasutana","Bibasis vasutana",
"Bibasis vasutana","Bibasis nikos")
)
thank you!!!