Say I have a list of every single letter in the alphabet
chars = c('a', 'b', 'c', 'd',...., 'y', 'z')
and a few lists
beg_vowels = c('a', 'e', 'i')
end_vowels = c('o', 'u', 'y')
lucky_constants = c('b', 'f', 'g')
I want to create a list the same size as the chars list but if the letter at that index in chars is in beg_vowels, its value is 'BV', if it's in end_vowels, its value is 'EV', if it's in lucky-constants its value is 'LC', and if it's not in any of them, its value is 'Unique'. So this new list, call it categor, should be something like
categor = c('BV', 'LC', 'Unique', ..., 'Unique', 'Unique')
I am planning to apply this concept for a very large list, so iterating through the chars list and comparing element by element is way too slow.