New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow non-interactive use of load_dataset() #19
Comments
This will require some careful thinking through, because the lexicon creators who agreed to have their work included in this way agreed because we set up for a user to agree to the license when they download, i.e. no commercial use, etc. That alternative does not sound like it is within the parameters we set up with the lexicon creators. |
Hello @richierocks, textdata was build to ensure the user would be forced to agree to the terms of the datasets. Allowing the functions to download the data non-interactively wouldn't work. however it is worth noting that interactivity is only needed the first time the data is being accessed. So you could call the functions once to agree to the conditions of the data, and then have subsequent analysis be done non-interactively. Please note that some of the datasets (especially the lexicons) comes with "do not redistribute", meaning that you wouldn't be able to put the data in a docker image for someone else to use as they haven't agreed to the conditions of use. |
In that case, I have 2 questions: Would you be happy with adding an load_dataset <- function(data_name, name, dir, delete, return_path, accept_license = printer("name")) {
if(!accept_license) {
stop("You need to accept the license before you can use this dataset.")
}
# rest of function as before
} That way the user has to explicitly say they are accepting the license by passing Failing that, is it possible to make |
I'm still not comfortable with adding an option to allow downloads without the prompt. If you buy a copy of the data, then you can place it in textdata's search path, and then the preprosessing and delivery will happen without the prompt. You can do this one of 2 ways.
|
I completely new to R. I downloaded afinn dataset and tried to change the directory of the afinn data. It still prompts the user to download afinn. Is this expected? Thanks! ` textdata::lexicon_afinn(dir = "/Users//Downloads/AFINN") 1: Yes |
Hello @umasenthil |
@EmilHvitfeldt Thank you for the clarification! |
@richierocks I tried your solution of overriding the printer() method. The I am trying to automate Rscripts. |
set eval=FALSE in code chunks that must be run interactively and add note explaining why EmilHvitfeldt/textdata#19
Currently
load_dataset()
callsprinter()
, which in turn callsmenu()
, which throws an error if R is run non-interactively.See
An example of wanting to use this function non-interactively is including the datasets in a Docker image.
I think that in a non-interactive session you can always assume that the user wants to download the dataset, so a possible reworking of
printer()
might be something like the following.That is, the message is changed from "Do you want to download" to "Downloading" and
menu()
is replaced by always returning1
.The text was updated successfully, but these errors were encountered: