0

I am doing a lyrical analysis of Paramore's discography using data from GeniusAPI. I have done most my analysis after going through data wrangling. I was able to create word clouds and bar charts based on sentiment analysis for each album. But now I am trying to conduct a topic model for one of these albums (Riot). To do this you have to make sure your data is a document term matrix.

Just at the first step an error message comes up when trying to do start the topic model

data(riottoken)

Error message: data set 'riottoken' not found"

Although I have used 'riottoken' for word clouds and sentiment analysis.

I tried to turn 'riottoken' (my data) into a corpus and a document term matrix using different codes and failed at this too. I will leave two examples below. Any help would be greatly appreciated.

NSPLG
  • 1
  • 1
    Why are you using ‘data(.)’ when you think the object is already in your workspace? Generally one would use ‘ls’. – IRTFM May 04 '21 at 19:17
  • Thanks for your reply. I am a beginner at coding, so I am just following someone's r markdown for topic modeling. https://www.tidytextmining.com/topicmodeling.html#latent-dirichlet-allocation – NSPLG May 04 '21 at 19:22
  • Can you share more of your R code? Do you load any packages before calling `data(riottoken)`? – Fred Boehm May 04 '21 at 19:29
  • Also, what do you see when you type `riottoken` within your R session? – Fred Boehm May 04 '21 at 19:31
  • i have quite a few packages loaded including tm, topic models, quanteda, tidy text. my data (riottoken is a tibble with 770 rows) – NSPLG May 04 '21 at 19:34
  • If `riottoken` is a tibble you created, there's no need to call `data(riottoken)`. The `data()` function is only for loading data from a package. It has nothing to do with your own data. If you are having other problems turning `riottoken` into a corpus, you should focus on that code instead. – MrFlick May 04 '21 at 19:50
  • okay thanks that makes sense, so how would I turn my tibble into a corpus? I have tried a few codes including this one but it is not working. the code-> corpus = corpus(VectorSource(RIOTtoken)) – NSPLG May 04 '21 at 19:59

0 Answers0