title: R: LDA Topicmodels - Where are the distributions over the terms?
body: <p>A topic is a multinomial distribution over the terms (=words) of a TermDocumentMatrix. Using a standard dataset with <code>k=5</code> as the number of topics... </p>
  
  <pre><code>library(topicmodels)
  data("AssociatedPress", package = "topicmodels")
  
  k &lt;- 5 
  lda &lt;- LDA(AssociatedPress[1:20,], control = list(alpha = 0.1), k)
  </code></pre>
  
  <p><code>str(lda)</code> gives the following output</p>
  
  <pre><code>Formal class 'LDA_VEM' [package "topicmodels"] with 14 slots
  ..@ alpha          : num 0.0184
  ..@ call           : language LDA(x = AssociatedPress[1:20, ], k = k, control = list(alpha = 0.1))
  ..@ Dim            : int [1:2] 20 10473
  ..@ control        :Formal class 'LDA_VEMcontrol' [package "topicmodels"] with 13 slots
  .. .. ..@ estimate.alpha: logi TRUE
  .. .. ..@ alpha         : num 0.1
  .. .. ..@ seed          : int 1437208609
  .. .. ..@ verbose       : int 0
  .. .. ..@ prefix        : chr
  .. .. ..@ save          : int 0
  .. .. ..@ nstart        : int 1
  .. .. ..@ best          : logi TRUE
  .. .. ..@ keep          : int 0
  .. .. ..@ estimate.beta : logi TRUE
  .. .. ..@ var           :Formal class 'OPTcontrol' [package "topicmodels"] with 2 slots
  .. .. .. .. ..@ iter.max: int 500
  .. .. .. .. ..@ tol     : num 1e-06
  .. .. ..@ em            :Formal class 'OPTcontrol' [package "topicmodels"] with 2 slots
  .. .. .. .. ..@ iter.max: int 1000
  .. .. .. .. ..@ tol     : num 1e-04
  .. .. ..@ initialize    : chr "random"
  ..@ k              : int 5
  ..@ terms          : chr [1:10473] "aaron" "abandon" "abandoned" "abandoning" ...
  ..@ documents      : NULL
  ..@ beta           : num [1:5, 1:10473] -100 -100 -100 -100 -100 -100 -100 -100 -100 -100 ...
  ..@ gamma          : num [1:20, 1:5] 7.00e-05 6.79e-05 7.22e-05 8.89e-05 2.79e-04 ...
  ..@ wordassignments:List of 5
  .. ..$ i   : int [1:2533] 1 1 1 1 1 1 1 1 1 1 ...
  .. ..$ j   : int [1:2533] 116 153 218 272 299 302 447 455 548 597 ...
  .. ..$ v   : num [1:2533] 5 5 5 5 5 5 5 5 5 5 ...
  .. ..$ nrow: int 20
  .. ..$ ncol: int 10473
  .. ..- attr(*, "class")= chr "simple_triplet_matrix"
  ..@ loglikelihood  : num [1:20] -1512 -1584 -1400 -1324 -418 ...
  ..@ iter           : int 12
  ..@ logLiks        : num(0) 
  ..@ n              : int 3636
  </code></pre>
  
  <p>There is no object in <code>lda</code> that seems to store the data I need. I know that <code>gamma</code> gives the distribution of the topics over the documents, but how can I access the distribution of the topics over the terms?</p>