0

I was trying the codes suggested in the book Text Mining with R by Julia Silge given in page of the book:

stock_tokens=stock_articles%>%
unnest(map(corpus,tidy))%>%
unnest_tokens(word,text)%>%
select(company,datetimestamp,word,id,heading)

error message from R:

Error in mutate_impl(.data, dots) : Evaluation error: cannot coerce class "c("WebCorpus", "VCorpus", "Corpus")" to a data.frame. In addition: Warning message: In tidy.default(.x[[i]], ...) : No method for tidying an S3 object of class WebCorpus , using as.data.frameNo method for tidying an S3 object of class VCorpus , using as.data.frameNo method for tidying an S3 object of class Corpus , using as.data.frame

I am not able to find the solution from the net. Any help will be greatly appreciated.

GeralexGR
  • 2,973
  • 6
  • 24
  • 33
  • I'm not sure what a WebCorpus is but this older question about Corpus to data.frame may be of use: https://stackoverflow.com/questions/24703920/r-tm-package-vcorpus-error-in-converting-corpus-to-data-frame – Stedy Aug 27 '17 at 05:25
  • I tried that too. But it is not working. I am getting the same error message – Pitabas Mohanty Aug 28 '17 at 06:42

0 Answers0