我有一个数据帧,它有1列和30 rows.In,每行是一个描述,包括3-4个句子。我希望能够找到在所有行之间共享的最常见的单词。即最独特的字符串。
例如,“苹果”可能是最常见的单词,出现了17次。
非常感谢大家!
发布于 2020-02-06 04:46:06
如果你能提供一个例子,答案会更容易一些。但不管怎样,我还是要试一下。
install.packages("tidyverse")
library(tidyverse)
install.packages("tidytext")
library(tidytext)
tidy_df <- df %>%
unnest_tokens(word, text) %>%
anti_join(stop_words) %>% # this will remove words such as "the", "a", "an"
count(word, sort = TRUE)https://stackoverflow.com/questions/60083648
复制相似问题