europepmc
europepmc copied to clipboard
europepmc::epmc_search: Error in pb_tick
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.
Thanks for alerting me. Would you mind sharing your file drug_list.csv with me? It would help me to better understand the issue.
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.
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.