Frequency of occurrence of two-pair combinations in text data in R
问题 I have a file with several string (text) variables where each respondent has written a sentence or two for each variable. I want to be able to find the frequency of each combination of words (i.e. how often "capability" occurs with "performance"). My code so far goes: #Setting up the data file data.text <- scan("C:/temp/tester.csv", what="char", sep="\n") #Change everything to lower text data.text <- tolower(data.text) #Split the strings into separate words data.words.list <- strsplit(data