library(RISmed)
## Warning: package 'RISmed' was built under R version 4.0.5
library(tibble)
## Warning: package 'tibble' was built under R version 4.0.5
search_query <- EUtilsSummary("Migraine AND Botox AND CGRP", db = "pubmed")
summary(search_query)
## Query:
## ("migraine disorders"[MeSH Terms] OR ("migraine"[All Fields] AND "disorders"[All Fields]) OR "migraine disorders"[All Fields] OR "migraine"[All Fields]) AND ("botulinum toxins, type a"[MeSH Terms] OR "type a botulinum toxins"[All Fields] OR "botox"[All Fields]) AND CGRP[All Fields]
##
## Result count: 58
QueryId(search_query)
## [1] "36114468" "36089629" "36006191" "35879242" "35680766" "35202143" ## [7] "34877663" "34477213" "34409517" "34130525" "33880725" "33730441" ## [13] "33693863" "33594686" "33567891" "33542885" "33441852" "33434187" ## [19] "33421995" "33348571" "33200944" "33125303" "33121445" "32990477" ## [25] "32731573" "32647152" "32437038" "31835997" "31686633" "31475573" ## [31] "31470791" "30336190" "29671241" "29571276" "29134730" "29131327" ## [37] "28527052" "28497257" "28041540" "27310178" "27300190" "26728188" ## [43] "26493010" "26245187" "25735000" "24673487" "24147647" "23775164" ## [49] "23136725" "23095108" "22862686" "22406987" "22188874" "21459461" ## [55] "21081780" "20728992" "20464603" "15330838"
records <- EUtilsGet(search_query, type="efetch") class(records)
## [1] "Medline" ## attr(,"package") ## [1] "RISmed"
res0 <- tibble( 'title' = ArticleTitle(records), 'abstract' = AbstractText(records), 'PMID' = PMID(records), 'year' = YearPubmed(records) %>% lapply('[[', 1) %>% lapply('[[', 1) %>% unlist())
write.csv(res0, file = "MigraineBotoxCGRPSearch.csv", row.names = FALSE)