To overcome the  below error, please follow the below steps:



This could be problem with the version of tm package installed. The above command will be work with tm package 5.1 Version.


Hence Remove the package:

Inline image 2


Downloading the tm package 5.1 version from the below URL:

http://cran.r-project.org/bin/windows/contrib/3.0/tm_0.5-10.zip


Install the package with the below 

Command: install.packages("tm_0.5-10.zip",repos=NULL) 

Please run the below command to check the version of tm installed.

packageVersion("tm")



and then run the DocumentTermMatrix and check.]