2

I'm trying to get_sentiments("afinn") and the "nrc" but I get this message:

Error: The textdata package is required to download the NRC word-emotion association lexicon. Install the textdata package to access this dataset.

How can I install the textdata package?

Ruben Bartelink
  • 59,778
  • 26
  • 187
  • 249
Philip
  • 21
  • 1
  • 3
  • 1
    Hi @Philip! In R, you can install packages with the function `install.packages()`. When you want to install different packages, just include the name of the package within the parenthesis. In your example, this would install `textdata`: `install.packages("textdata")`. – cimentadaj Jan 17 '20 at 09:01
  • 1
    If you want some context on why this is happening, the following post by Julia Silge (co-author of tidytext) could be useful. https://juliasilge.com/blog/sentiment-lexicons/ I'm guessing you might have just updated tidy text and are confused why previously working functions now require you to have additional libraries installed ... The solution is what cimentadaj suggested. – JFlynn Jan 17 '20 at 11:42

1 Answers1

0

You can install R packages via the install.package("textdata") function. Instead of "textdata" you can write each package that you need, but make sure that after installing a package use library("textdata") function before calling its functions..

dandrews
  • 967
  • 5
  • 18