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:
Downloading the tm package 5.1 version from the below URL:
Install the package with the below
Please run the below command to check the version of tm installed.
and then run the DocumentTermMatrix and check.]