I would like to find exact matches for "A1" and "A6" in the vector:
myfile=paste("A",c(1:10),sep="")
I used str_detect from the stringr package:
toMatch <- c("A1", "A6")
str_detect(myfile,fixed(paste(toMatch,collapse="|")))
but it returns TRUE also for partial match with "A10".
Any other funs that could work?