EmilHvitfeldt / textdata

Download, parse, store, and load text datasets instead of storing it in packages

Home Page:https://emilhvitfeldt.github.io/textdata/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add non-interactive option

Ocete opened this issue · comments

commented

Hi! Thanks for your hard work on this repo :) I've been using it for an analysis lately and I run into a problem.

My goal was to deploy a Shiny App that uses the NRC dataset. The app would work locally but it wouldn't when I deployed it. This is because every time I tried to run get_sentiments("nrc"), a menu is used asking whether I wanted to download the dataset. This is shown in the demo:
https://github.com/EmilHvitfeldt/textdata/blob/master/man/figures/textdata_demo.gif

I would suggest to add a parameter so the answer to that menu is automatically "Yes", and it downloads whatever it needs without asking.

I managed to finish my app by using the dataset locally so no rush for me, but I think I would be a nice addition. Tell me what you think :)

Hello @Ocete!

It is a conscious decision not to have an argument to turn off the prompt and it will not change.

If you want to continue using textdata then you can download the data outside of R and let textdata point to it correctly #28.

commented

Thanks for your answer! May I ask why?

Sure thing!

For some of the datasets in this package, we got permission from the authors to have them accessible. One of the conditions was that the prompt appeared forcing the user to accept conditions for the data. (doing it this way also helps with CRAN licenses issues)

We can see how this promise is broken if we allow an argument to answer the prompt. Suppose we called this argument yes then another package to depend on textdata and create a function like get_afinn(). This function to be identical to lexicon_afinn() but without the prompt.

get_afinn <- function(...) {
  lexicon_afinn(..., yes = TRUE)
}
commented

That makes total sense, thank you very much :)