1

I have been working on working on applying top.topic.words function and I have got this error.Would anyone be able to help me out with this?.

> top.words <- top.topic.words(l$V1, 5, by.score=TRUE) Error in l$V1 : $ operator not defined for this S4 class

  • 1
    It depends on what you have created as the object `l`. Try `class(l)` and see what you get. Does `l$V1` work as a standalone command? (I expect not) – JDL Oct 10 '17 at 08:04
  • I am a newbie in both R and text analysis. Having a tough time. This is what I am getting: > class(l) [1] "LDA_Gibbs" attr(,"package") [1] "topicmodels" – Adee Thyagarajan Oct 10 '17 at 08:23
  • 1
    Right — you can only use `$` with `data.frame` objects and similar. Consult the help pages for `LDA_Gibbs` and `topicmodels` for how to extract the `V1` element of this object. – JDL Oct 10 '17 at 08:34
  • Thanks a lot for the helping out. Will go through it and try to figure out. :) – Adee Thyagarajan Oct 10 '17 at 08:39
  • `l@V1` - hope this helps. https://stackoverflow.com/questions/4713968/r-what-are-slots – jogo Oct 10 '17 at 09:00

0 Answers0