rentrez to retrieve NIH files I'm trying to use rentrez package to retrieve NIH files, and ran the following code (I followed what was on the rentrez tutorial):

pubmed_search &lt;- entrez_search(db = "pubmed", 
                    term = "Case Reports[Filter] AND cardiovascular disease AND English[lang] AND 2009:2019[PDat])", 
                    retmax = 792711, 
                    use_history = TRUE)

for(i in seq(1,10000,100)){   
    recs &lt;- entrez_summary(db="pubmed", 
                           web_history=pubmed_search$web_history,
                           retmax=100, 
                           retstart=i)   cat(    
seq_start+99, "sequences downloaded\r") }


However, instead of the 10,000 texts I expected, I only downloaded 100 files. Could so
I don't program in R, but replace the last line of you code with the following and I suspect you will find it works,

for(i in seq(1,10000,1)){ recs &lt;- entrez_summary(db="pubmed", web_history=pubmed_search$web_history, retmax=100, retstart=i) cat(seq_start+99, "sequences downloaded\r") }


Rationale I would guess seq is similar to the linspace function in Python, and put simply 10000 (total sample size) / 100 (the step size) = 100, 100 being the number of downloads you observed. In the code above its 10000/1. I would also suspect "step size = 1" is default, if this was correct then seq(1,10000) would give you your required output.

As a random aside I do like the presence of curly brackets defining the loop, it reminds me of Perl.