bstewart / stm

An R Package for the Structural Topic Model
Other
401 stars 98 forks source link

Export TopicCorr into graph object #242

Open paulyups opened 3 years ago

paulyups commented 3 years ago

Greetings. Since I am not very good at coding, I tend to export graphs to Gelphi for further adjustment. Hence, I would like to know if there is any way for me to export the TopicCorr object into a graph object that I can export out?

Furthermore, same as the LabelTopic function, I would like to export the Label Topic object out so I can translate the term into English. How can I do it?

Thanks. Don't roast me if the question is too stupid.

fridrichmrtn commented 3 years ago

Hi,

You can extract the correlation matrix with something like: rcorr_mat = Hmisc::rcorr(stm_model$theta) Consequently, condense the result into the edge object you need other tools such as igraph, Gephi, etc.

I am not sure what you mean by the second question, but you can directly control the topic labels in the plot.STM function.

Br,

MF