Hi i have two arrays 'topWords' of length N (unique words), and 'observedWords' with length < N (repetitions of words).
I'd like an array of counts 'countArray' of length N containing the number of times each of the N words in 'topWords' occurs in the array 'observedWords'. What is an efficient way to do this in R?