逆项凭证的组变量

问题描述

运行this示例:

dataset1 <- data.frame( anumber = c(1,2,3),text = c("Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s,when an unkNown printer took a galley of type and scrambled it to make a type specimen book.","It has survived not only five centuries,but also the leap into electronic typesetting,remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages,and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum","Contrary to popular belief,Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC,making it over 2000 years old. Richard Mcclintock,a Latin professor at Hampden-Sydney College in Virginia,looked up one of the more obscure Latin words,consectetur,from a Lorem Ipsum passage,and going through the cites of the word in classical literature,discovered the undoubtable source."))

library("quanteda",warn.conflicts = FALSE)
## Package version: 2.1.1

myDfm <- dataset1 %>%
    corpus(docid_field = "anumber") %>%
    tokens(remove_punct = TRUE,remove_numbers = TRUE,remove_symbols = TRUE) %>%
    tokens_ngrams(n = 1:2) %>%
    dfm()

myDfm %>%
    dfm_tfidf() %>%
    convert(to = "data.frame") %>%
    dplyr::group_by(doc_id) %>%
    tidyr::gather(key = "word",value = "tf_idf",-doc_id) %>%
    tibble::tibble()

存在一个错误

Error: Must group by variables found in `.data`.
* Column `doc_id` is not found.
Run `rlang::last_error()` to see where the error occurred.

不幸的是,我可以重现更多,任何可以重现或收到此错误的人吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...