Performing pubmed quieries with R

tutorial here

some other samples of PubMed searches

RISmed another RISmed example easyPubmed for business nah, this one

if(!require(easyPubMed)){
  install.packages("easyPubMed") }
## Loading required package: easyPubMed
## Warning: package 'easyPubMed' was built under R version 3.5.2
library(easyPubMed)
library(tidyverse)
## ── Attaching packages ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── tidyverse 1.2.1 ──
## ✔ ggplot2 3.2.1     ✔ purrr   0.3.2
## ✔ tibble  2.1.3     ✔ dplyr   0.8.3
## ✔ tidyr   1.0.0     ✔ stringr 1.4.0
## ✔ readr   1.3.1     ✔ forcats 0.4.0
## Warning: package 'ggplot2' was built under R version 3.5.2
## Warning: package 'tibble' was built under R version 3.5.2
## Warning: package 'tidyr' was built under R version 3.5.2
## Warning: package 'purrr' was built under R version 3.5.2
## Warning: package 'dplyr' was built under R version 3.5.2
## Warning: package 'forcats' was built under R version 3.5.2
## ── Conflicts ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
library(XML)
## Warning: package 'XML' was built under R version 3.5.2
new_PM_query <- "(APEX1[TI] OR OGG1[TI]) AND (2010[PDAT]:2013[PDAT])"
out.B <- batch_pubmed_download(pubmed_query_string = new_PM_query, dest_file_prefix = "apex1_sample")
## [1] "PubMed data batch 1 / 1 downloaded..."
# Retrieve the full name of the XML file downloaded in the previous step
new_PM_file <- out.B[1]
new_PM_df <- table_articles_byAuth(pubmed_data = new_PM_file, included_authors = "first", max_chars = 0)
## Processing PubMed data .................................................. done!
# Alternatively, the output of a fetch_pubmed_data() could have been used
# Printing a sample of the resulting data frame
new_PM_df$address <- substr(new_PM_df$address, 1, 28)
new_PM_df$jabbrv <- substr(new_PM_df$jabbrv, 1, 9)
print(new_PM_df[1:10, c("pmid", "year", "jabbrv", "lastname", "address")])  
##        pmid year    jabbrv    lastname                      address
## 1  24190502 2015 Arch. Tox        Bach Grup de Mutagènesi, Departam
## 2  24186001 2014 Tumour Bi         Yan Department of Clinical Labor
## 3  24175791 2014 Asian Pac          Li Cancer Center, Daping Hospit
## 4  24121118 2014 Mech. Age    Lillenes Centre for Molecular Biology
## 5  24101388 2014 J. Physio Antushevich The Kielanowski Institute of
## 6  24075420 2014 DNA Repai          Gu State Key Laboratory of Repr
## 7  23999824 2014 Tumour Bi        Chen Department of Hepatobiliary 
## 8  23959014 2014 Biol. Res     Alanazi Genome Research Chair, Depar
## 9  23909557 2014 Genet Tes        Wang Department of Oncology, Shan
## 10 23892003 2014 Exp. Cell         Yan State Key Laboratory of Repr