फेंक रहा है मैं विभिन्न अलग-अलग स्पोर्ट्स टीमों के ट्वीट्स के आधार पर वर्ड क्लाउड बना रहा हूं। इस कोड को 10 बार में सफलतापूर्वक के बारे में 1 कार्यान्वित:TermDocumentMatrix कभी-कभी त्रुटि
Error in simple_triplet_matrix(i = i, j = j, v = as.numeric(v), nrow = length(allTerms), :
'i, j, v' different lengths
In addition: Warning messages:
1: In mclapply(unname(content(x)), termFreq, control) :
all scheduled cores encountered errors in user code
2: In simple_triplet_matrix(i = i, j = j, v = as.numeric(v), nrow = length(allTerms), :
NAs introduced by coercion
कोई भी विचार लोग:
handle <- 'arsenal'
txt <- searchTwitter(handle,n=1000,lang='en')
t <- sapply(txt,function(x) x$getText())
t <- gsub('http.*\\s*|RT|Retweet','',t)
t <- gsub(handle,'',t)
t_c <- Corpus(VectorSource(t))
tdm = TermDocumentMatrix(t_c,control = list(removePunctuation = TRUE,stopwords = stopwords("english"),removeNumbers = TRUE, content_transformer(tolower)))
m = as.matrix(tdm)
word_freqs = sort(rowSums(m), decreasing=TRUE)
dm = data.frame(word=names(word_freqs), freq=word_freqs)
wordcloud(dm$word, dm$freq, random.order=FALSE, colors=brewer.pal(8, "Dark2"),rot.per=0.5)
अन्य 9 10 बार से बाहर है, यह निम्न त्रुटि फेंकता है? मैंने गुमराह किया है, लेकिन अब तक कम हो गया है! ध्यान रखें मैं आर में एक पूर्ण नौसिखिया हूँ!
यह मेरी समस्या को तुरंत ठीक कर सकता है (मैक पर चल रहा है)। – timothyjgraham