除了问题R文本挖掘-如何将R数据框列中的文本更改为具有词频的几列?我想知道如何设法制作具有双连词频率的列,而不仅仅是词频。再次,提前非常感谢!
这是示例数据框(感谢 Tyler Rinker)。
person sex adult state code
1 sam m 0 Computer is fun. Not too fun. K1
2 greg m 0 No it's not, it's dumb. K2
3 teacher m 1 What should we do? K3
4 sam m 0 You liar, it stinks! K4
5 greg m 0 I am telling the truth! K5
6 sally f 0 How can we be certain? K6
7 greg m 0 There is no way. K7
8 sam m 0 I distrust you. K8
9 sally f 0 What are you talking about? K9
10 researcher f 1 Shall we move on? Good then. K10
11 greg m 0 I'm hungry. Let's eat. You already? K11
上面的数据集:
library(qdap); DATA