To conduct a systematic review/Citation Network Analysis/ Bibliometric analysis, bibliography from databases is required. RISMed package in R helps in automating the process and saves a lot of effort and time of researchers in the process.
This code gives a step wise algorithm for automated data extraction from PubMed database

Step 1. Load library

library(RISmed)

Step 2. Enter search terms

search_topic = '(R AND Machine Learning AND Python)' 

Step 3. Create Pubmed search query

search_query = EUtilsSummary(search_topic,retmax = 10000)

Optional step. Check number of articles found with search query

summary(search_query)
## Query:
## R[All Fields] AND ("machine learning"[MeSH Terms] OR ("machine"[All Fields] AND "learning"[All Fields]) OR "machine learning"[All Fields]) AND ("boidae"[MeSH Terms] OR "boidae"[All Fields] OR "python"[All Fields]) 
## 
## Result count:  21

Step 4. Extraction of data from Pubmed as a Medline/RISMed object

Medline_object = EUtilsGet(search_query)

Step 5. Covert search query results into a data.frame

df_from_pubmed = bibliometrix::pubmed2df(Medline_object)
## 
## Downloading updated citations from PubMed/MedLine...

Lastly, save file for further analysis and needful using write_csv function from tidyverse package.