I am getting an error message 'Error in simple_triplet_matrix(i, j, v, nrow = length(terms), ncol = length(corpus), : 'i, j' invalid'
While creating the DocumentTermMatrix or creating a Word Cloud.This is happening in all data sets.Here is the code I used
corpus=tm_map(corpus,tolower)
corpus=tm_map(corpus,removePunctuation)
corpus=tm_map(corpus,removeWords,stopwords("english"))
corpus=tm_map(corpus,stemDocument)
corpus <- tm_map(corpus, PlainTextDocument)
library("SnowballC")
dtm=DocumentTermMatrix(corpus)
library("wordcloud")
wordcloud(corpus,min.freq=4,scale=c(5,1),random.color=F,max.words=45,random.order=F)
I have recently changed my computer and Reinstalled R(3.3.4).Not sure if that is causing this problem.Everything was working fine on the old PC.Please help.
PS: I tried to read through all the available questions this topic and suggestions like installing 'SnowballC' package etc are not helping me Any help will be much appreciated.
Thanks, Nidhin VC