R 如何获取count&;在一列中重复多次的字串

R 如何获取count&;在一列中重复多次的字串,r,R,你好,我正在进行NPS和CSAT分析。我有一个专栏,里面写满了客户的评论,试图找出他们的问题和问题的根本原因 comments <- c("My order took too much time to deliver.", "Logistics is the main problem.", "Late time delivery.", "Why do you need additional time to deliver my product.", "You need to stre

你好,我正在进行NPS和CSAT分析。我有一个专栏,里面写满了客户的评论,试图找出他们的问题和问题的根本原因

comments <- c("My order took too much time to deliver.",
 "Logistics is the main problem.",
 "Late time delivery.",
 "Why do you need additional time to deliver my product.",
"You need to streamline your process towards quick delivery")

comments您可以使用
tidytext
包-特别是
unnest\u令牌
功能:

library(tidytext)
library(dplyr)
comments <- c("My order took too much time to deliver.",
              "Logistics is the main problem.",
              "Late time delivery.",
              "Why do you need additional time to deliver my product.",
              "You need to streamline your process towards quick delivery")
comment.df <- tibble(comment=comments)

tidy_comments <- unnest_tokens(comment.df, word, comment)

tidy_comments <- tidy_comments %>% count(word, sort=TRUE)

库(tidytext)
图书馆(dplyr)

注释您可以使用
tidytext
包-特别是
unnest\u令牌
功能:

library(tidytext)
library(dplyr)
comments <- c("My order took too much time to deliver.",
              "Logistics is the main problem.",
              "Late time delivery.",
              "Why do you need additional time to deliver my product.",
              "You need to streamline your process towards quick delivery")
comment.df <- tibble(comment=comments)

tidy_comments <- unnest_tokens(comment.df, word, comment)

tidy_comments <- tidy_comments %>% count(word, sort=TRUE)

库(tidytext)
图书馆(dplyr)

我不清楚你具体在找什么。具有所需输出的可复制示例将有助于澄清。我建议使用
tidytext
包及其
unnest\u令牌
函数来实现这一点。我不清楚你具体在找什么。具有所需输出的可复制示例将有助于澄清。我建议使用
tidytext
包及其
unnest\u令牌
函数来实现这一点。