[R] Calculating shortest path length among multiple graphs

2014-12-24 Thread
Hi, I have an edgelist network data (undirected) with multiple graphs like this. For each graph (i.e., denoted by doc.id), I want to calculate the shortest path length (SPL) between the nodes. By using the code attached below, I can only calculate the SPL for only 1 graph at a time. How can I handl

[R] Assigning document id to each document containing in the Document Term Matrix (R Package "tm")

2014-06-24 Thread
Dear All, When I do "DocumentTermMatrix" analysis, can I assign a document id to the document (i.e., the row in the attached matrix marked in red)? Here is my code: tdm=DocumentTermMatrix(corpus,control) inspect (tdm2[5:20,9:14]) Terms Docs 002089 002223 002236 002268 002415 002439 5

[R] Retaining the original document id in #topicmodels in R

2014-06-24 Thread
Hi all, I am currently using package "topicmodels" to find the topics of a given text. The dataset contains 8523 documents. I would like to see which documents belong to which topic. Here is my code: get the documentTermMatrix# tdm=DocumentTermMatrix(corpus,control)

[R] Retaining the original document id in #topicmodels in R

2014-06-24 Thread
Hi all, I am currently using package "topicmodels" to find the topics of a given text. The dataset contains 8523 documents. I would like to see which documents belong to which topic. Here is my code: get the documentTermMatrix# tdm=DocumentTermMatrix(corpus,control)