Skip to content
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

europepmc::epmc_search: Error in pb_tick #36

Open
Dobrokhotov1989 opened this issue Nov 18, 2020 · 3 comments
Open

europepmc::epmc_search: Error in pb_tick #36

Dobrokhotov1989 opened this issue Nov 18, 2020 · 3 comments

Comments

@Dobrokhotov1989
Copy link

Hi,

Last few days I was using an epmc_search function to retrieve data from the EuropePMC database and sometimes I get the following error (of cause number of records are different, depending on the search):

1498 records found, returning 1498
(\) [=================================================] 100%
Error in pb_tick(self, private, len, tokens) : !self$finished is not TRUE

Here is the code I use:

library(europepmc)

queries = read.csv("drug_list.csv")

j = 20
while (j <= nrow(queries)){
  search_results = europepmc::epmc_search(query = paste0("(METHODS:", queries[j, 'epmc'], ") AND (OPEN_ACCESS:y)"),
                                          limit = 3000);
  #some operations with search_result here
  j = j + 1
}

Sometimes it works just fine, sometimes it constantly returns the abovementioned error message. As I don't change the code between runs, I can't catch what can cause the issue.

@njahn82
Copy link
Member

njahn82 commented Nov 19, 2020

Thanks for alerting me. Would you mind sharing your file drug_list.csv with me? It would help me to better understand the issue.

@Dobrokhotov1989
Copy link
Author

Yes, sure. Github does not allow to attach *.csv files, therefore I save the csv to txt, so please convert it back to csv.

Lately, it constantly crashes at j = 13.

Drug_list.txt

njahn82 added a commit that referenced this issue Nov 24, 2020
…turned to avoid calling pb_tick on a completed progress bar in a loop #36
@njahn82
Copy link
Member

njahn82 commented Nov 24, 2020

Thanks again for reporting the issue, which should be fixed now in the dev version.

You can install the dev version from GitHub using

remotes::install_github("ropensci/europepmc")

In case you do not want to install the dev-version, you can set verbose = FALSE when calling europepmc::epmc_search(). Then, the progress bar function is not called.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants