Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/77.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 找不到函数“;非最新的“代币”;_R_Tidytext_Unnest - Fatal编程技术网

R 找不到函数“;非最新的“代币”;

R 找不到函数“;非最新的“代币”;,r,tidytext,unnest,R,Tidytext,Unnest,我试图使用tokenizers包将列拆分为令牌,但我一直收到一个错误:找不到函数“unnest_tokens”。我正在使用R3.5.3,已经安装并重新安装了dplyr、tidytext、tidyverse、tokenizers、tidyr,但仍然收到错误 我也退出并重新启动了R和RStudio comments_tidy <- comments %>% unnest_tokens(word, txt) %>% #Break the comments into individ

我试图使用tokenizers包将列拆分为令牌,但我一直收到一个错误:找不到函数“unnest_tokens”。我正在使用R3.5.3,已经安装并重新安装了dplyr、tidytext、tidyverse、tokenizers、tidyr,但仍然收到错误

我也退出并重新启动了R和RStudio

comments_tidy <- comments %>%
  unnest_tokens(word, txt) %>% #Break the comments into individual words
  filter(!word %in% undesirable_words) %>% #Remove undesirables
  anti_join(stop_words) #Data provided by the tidytext package
注释\u%
unnest_标记(word,txt)%>%#将注释分解为单个单词
筛选(!单词%in%不需要的单词)%>%#删除不需要的单词
反连接(停止字)#由tidytext包提供的数据
我收到以下消息:

unnest_标记(、word、txt)中出错:
找不到函数“unnest_令牌”


如注释中所述,您可能希望使用
library(x)
语句扩展代码。此外,请确保安装了所有软件包及其依赖项。下面的代码段将查找给定的包(在本例中为
dplyr
),并在需要时安装它

if ("dplyr" %in% installed.packages()[, "Package"]){ 
  cat("'dplyr' is installed.")
} else {
  install.packages("dplyr",dependencies=T)
}
library(dplyr)

命令
installed.packages()[,“Package”]?
为您提供了所有已安装软件包的列表,这是调试所有类型的
函数foo not found
错误的好方法。

您是否调用了
库(x)
<代码>库(y)?是的,我为描述中提到的包调用了每个库。请尽量明确:
tidytext::unest_tokens()
谢谢!显式函数也帮助了我。