0

For presentation, I would like to re-label the topic number of STM topic modeling (e.g., change 'topic 40' into 'topic 1'). I am however not sure where I should change (where are the topic numbers stored?).

glts
  • 21,808
  • 12
  • 73
  • 94
user7453767
  • 339
  • 2
  • 14

2 Answers2

0

Relabel for what purpose? Essentially all the plotting functions offer custom labels. Try the excellent tidystm package (https://github.com/mikaelpoul/tidystm) for even more control over the graphics.

bstewart
  • 508
  • 3
  • 8
  • This is because I do not want to present in my paper that topic 40 and topic 1 are kin topics; rather I want to label them as 'topic 1' and 'topic 2'. But I don't know how to change them. – user7453767 Jun 12 '18 at 10:12
  • There are so many things that plot topics in the package, you have to be more specific. Assuming you mean plot.STM though here is some sample code of the labeling: plot(gadarianFit, topic.names=c("My Label:", "My Label2:", "Another Label:")) – bstewart Jun 12 '18 at 15:11
-1

Create a vector of custom topic names as desired

topicNames<-c("topic 1","topic 2", etc)

Then when you plot, use your custom topicNames as below

plot(x,type="summary",custom.labels="", topic.names=topicNames, ...)

Your topicNames will Default to the STM "Topic #: ".

landrower
  • 475
  • 6
  • 11