Count number of times a word-wildcard appears in text (in R)
问题 I have a vector of either regular words ("activated") or wildcard words ("activat*"). I want to: 1) Count the number of times each word appears in a given text (i.e., if "activated" appears in text, "activated" frequency would be 1). 2) Count the number of times each word wildcard appears in a text (i.e., if "activated" and "activation" appear in text, "activat*" frequency would be 2). I'm able to achieve (1), but not (2). Can anyone please help? thanks. library(tm) library(qdap) text <-