Closed arencambre closed 4 years ago
Thanks so much @arencambre! I added some clarifying language, including:
These lexicons are available under different licenses, so be sure that the license for the lexicon you want to use is appropriate for your project. You may be asked to agree to a license before downloading data.
Thanks @juliasilge . While that text helps, the textdata package appears to be required for you to use some (all?) of these lexicons. I think the example code should load the textdata package right after tidyverse.
The textdata package is in Suggests
for tidytext, so users don't need to load it. None of this code uses textdata functions directly.
Sorry, I guess I could have worded this differently. I've experienced the rest of your book examples as being pretty turn-key: running the provided code produces the expected result, and if not, there is explanatory text.
In this case, there is a dependency that is not clearly explained in the text or code samples, which is that the textdata library needs to be installed. You are correct that it doesn't need to be loaded using the library() function (sorry for my mis-statement on that above), but it does need to be installed.
Thanks so much for this feedback @arencambre; I appreciate it.
I'm going to think about the options here. My current opinion is that the explanatory text the user sees in the situation where they have installed tidytext but not textdata is quite clear about what step they need to take. However, there are changes we could make, such as moving textdata from Suggests
to Imports
in the way that stopwords for example is Imports
. Originally I decided to keep textdata as only Suggests
because users of tidytext may not be interested in doing sentiment analysis.
Interesting question. I haven't seen examples of where a package has a dependency that isn't installed along with the package, so I am shooting from the hip with ideas.
I read your concern being that this is a minor or less common use of tidytext? I checked textdata, and it's only ½ MB, so if it was just me, I'd make it Imports.
Alternatives:
"textdata" %in% installed.packages()[,"Package"]
. If not, either give friendly message and stop execution, or give user option to install textdata. While "just install it right here" has appeal, I'm assuming it would be poor form for a package to install another package without the user's permission.
In 02-sentiment-analysis.Rmd, the get_sentiments(...) function barks at you to use textdata. Once you have that, you must work through some interactive prompts the first time you use each lexicon. That is not reflected in the text.