Given a set of any # of vectors:
a<-c("giraffe", "dolphin", "pig")
b<-c("elephant" , "pig")
c<-c("zebra","cobra","spider","porcupine")
d<-c("porcupine")
e<-c("spider","cobra")
f<-c("elephant","pig","porcupine")
and a target vector:
target<- c("elephant" , "pig","cobra","spider","porcupine")
Is there a way to check if any combinations of the vectors can match the target vector (order doesn't matter)?
In this case, answers would be:
- b,d,e
- e,f
Clarifying: I need to know which combinations exactly match the target vector with no duplicates. Any answers that would repeat a value (e.x. b,d,e,f) would not work.