[R] Rgraphviz and NA indices error

Sun Shine phaedrusv at gmail.com
Thu Feb 26 11:38:28 CET 2015


Hi list

Can someone help me debug the following please:

Having downloaded and installed the bioconductor packages and Rgraphviz, 
I am attempting to plot a network graph showing the relation among 
chosen words in the corpus of text data.

I first did this:
 > plot(dtm, terms=findFreqTerms(dtm, lowfreq=100) [1:30], 
corThreshold=0.75)

and received the error message:

Error in `[.simple_triplet_matrix`(m, , terms) : NA indices not allowed.


My next step was to remove any NA indices (although to be honest, this 
is more of a stab in the dark because there shouldn't be any NA values 
in the corpus):

 > docsNA <- (docs[!is.na(docs)])

Then redid the DTM with the NA values removed
 > dtmNA <- DocumentTermMatrix(docsNA)

Then re-ran Rgraphviv with the new set
 > plot(dtmNA, terms=findFreqTerms(dtmNA, lowfreq=100) [1:10], 
corThreshold=0.5)

But, still get an error:
Error in `[.simple_triplet_matrix`(m, , terms) : NA indices not allowed.

I have not been successful in finding out why this error persists nor 
what to do about it.

Anyone have any ideas to progress past this issue?

Thanks

Sun



More information about the R-help mailing list