0

I am running the following code chunk

tdm = TermDocumentMatrix(ctext,control=list(minWordLength=1))
print(tdm)

inspect(tdm[10:20,11:18])

out = findFreqTerms(tdm,lowfreq=5)
print(out)

When I run it in console it runs fine. However when I include it as part of a RMD and try to Knit HTML (ioslides) I get an error:

Error:

inherits(doc, "TextDocument") is not TRUE

Raviteja
  • 3,399
  • 23
  • 42
  • 69
FlyingPickle
  • 1,047
  • 1
  • 9
  • 19
  • Welcome to SO. Please edit your post and provide a full example with which readers can reproduce your error. – lukeA Mar 17 '16 at 06:48

1 Answers1

1

I had the same problem.

The problem is basically with the version of tm package. You can't really help it.

Use content_transformer function in tm_map function. It resolved the error for me.

Hope it helps.

Pragyaditya Das
  • 1,648
  • 6
  • 25
  • 44