【发布时间】:2020-02-11 23:51:38
【问题描述】:
我需要将文本数据标记为下面的代码,但会产生错误。如何解决?谢谢!
library(readr)
europeecondata <- read_csv("C:/Users/lin/Documents/europeecondata.csv")
european_text <- data_frame(line=1:273, text=europeecondata$text)
european_text$text <- gsub("http[^[:space:]]*","", european_text$text) # For http
european_text$text <- gsub("http[^[:space:]]*","", european_text$text) # For https
data(stop_words)
euro_tokens <- european_text$text %>%
unnest_tokens(word, text) %>%
anti_join(stop_words)%>%
count(word, sort=T)
输出: UseMethod("unnest_tokens_") 中的错误: 没有适用于“字符”类对象的“unnest_tokens_”方法
【问题讨论】:
-
See here 提出一个人们可以帮助解决的 R 问题。这包括数据样本;现在我们无法在没有任何数据的情况下运行您的任何代码,也看不到您正在使用什么