The readTabular() function is gone in the newest version of tm. What do we use as its replacement?

耗尽温柔 提交于 2020-07-30 05:52:50

问题


In tm version 0.7-1, there was a readTabular() function. Now it is gone, and if you try to use it, there is no deprecation message or warning or anything, like you might reasonably expect. It's just gone. In the distant past (4 days ago), it could be used like:

library(tm)

myReader <- tm::readTabular(mapping=list(id="id", content="content"))
cor <- tm::VCorpus(tm::DataframeSource(dt), readerControl = list(reader = myReader))

So how do you do something like that in the newest version of tm, 0.7-2?

PS: I think the newest version was released about 4 days ago as of this post, but it's pretty hard to tell from the news section of the repo, which seems to have a nasty formatting bug or something. Also, I think readTabular was introduced in 2009 as 'experimental'. No idea why it was removed, if anyone can find any explanation anywhere in the repo, please post the link. Here's the docs for readTabular.


回答1:


Per "news for package tm" on CRAN (https://cran.r-project.org/web/packages/tm/news.html):

readTabular() has been removed. Use DataframeSource instead.



来源:https://stackoverflow.com/questions/47604511/the-readtabular-function-is-gone-in-the-newest-version-of-tm-what-do-we-use-a

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!