我试图仅提取数据框中某列的唯一值。这是一个例子:
SelectedRowsCount == 0
我想过滤第二列" word2"只包含独特的单词,所以只有#34;漂亮的"出现一次,该列" n"为所有"美丽","强大"加上所有计数。等
所以它应该是这样的:
df <- data.frame(word1=c("not","but","not","not","never","nor","never","not"),
word2=c("beautiful","nice","strong","awesome","beautiful","beautiful","strong","nice"),
n=c(400,378,29,10,222,43,620,90))
df
在此示例中,列&#34; word2&#34;只包含4个单词,但我的真实数据框包含数千个单词,所以我不能使用像#34; ==美丽,强大的运算符......&#34;
非常感谢你!