I have a keyword (e.g. \'green\') and some text (\"I do not like them Sam I Am!\").
I\'d like to see how many of the characters in the keyword (\'g\', \'r\',
Perhaps you are looking to find the UNIQUE components of your keyword? Try:
keyword <- unique(strsplit('greeen','')[[1]])