europepmc icon indicating copy to clipboard operation
europepmc copied to clipboard

europepmc::epmc_search: Error in pb_tick

Open Dobrokhotov1989 opened this issue 4 years ago • 3 comments

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.

Dobrokhotov1989 avatar Nov 18 '20 02:11 Dobrokhotov1989

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

njahn82 avatar Nov 19 '20 08:11 njahn82

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

Dobrokhotov1989 avatar Nov 20 '20 04:11 Dobrokhotov1989

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.

njahn82 avatar Nov 24 '20 12:11 njahn82