[R] Names in vector occurring in another vector

Leeds, Mark (IED) Mark.Leeds at morganstanley.com
Mon Apr 16 20:20:24 CEST 2007

I have a vector of character strings such as

mainnames<-c("CAD","AUD") and another vector say


I want a new vector of character strings that is just

Because any time a name occurs in checknames that has a subset that
matches with mainnames, the
name in checknames should not be in the final result !!!!!!!!!!!!!!!!!

I can't use %in% because this example doesn't require exact matching.
The general problem would always have an  "el after the dot but the
numbers can go upto double digits.
Thanks a lot.


This is not an offer (or solicitation of an offer) to buy/se...{{dropped}}

More information about the R-help mailing list