This is a test version of Biostars. For the public version, visit https://www.biostars.org.
R script to download all abstracts of Nature in 2020 from Pubmed

Dear All,

Anyone can share a R command to download all abstracts of Nature in 2020 from Pubmed

Thanks.

pubmed abstract

You might wish to have a look at this tool. See the end of the webpage for examples.

2 answers

library(rentrez)

paper_ids <- entrez_search(db = "pubmed",
            "Nature[jour] AND 2020[dp]",
            retmax = 9999,
            use_history = T)

raw_abs <- entrez_fetch(db="pubmed",
                    web_history = paper_ids$web_history,
                    rettype="abstract")

Find another way as good as @Alex Nesmelov's proposal. Thanks Alex Nesmelov!

library(easyPubMed)
my_query <- 'Damiano Fantini[AU] AND "2018"[PDAT]'
my_entrez_id <- get_pubmed_ids(my_query)
my_abstracts_txt <- fetch_pubmed_data(my_entrez_id, format = "abstract")

You should consider accepting @Alex's answer in that case, since it must work and it gave you the direction to find your own.

Log in to answer this question.