是否有R包可基于数据库查询直接生成.ris参考文献文件?
Got it, let's break down the tools you need for automated literature scraping and RIS/data frame output in R—no more manual page-by-page exporting! Here are the best options tailored to your target databases:
rcrossref (covers Science Direct, Wiley, and more via CrossRef)
CrossRef aggregates metadata from thousands of publishers, including Science Direct and Wiley. The rcrossref package lets you query this database directly, then convert results to data frames or RIS files easily. It’s free and doesn’t require an API key for basic use.
Example workflow:
library(rcrossref) library(bib2df) # For format conversion # Run a search (adjust query and limit as needed) search_results <- cr_works(query = "sustainable agriculture", limit = 150) # Convert results to a structured data frame lit_df <- bib2df(search_results$data$bibtex) # Export to RIS file bib2df::df2ris(lit_df, file = "crossref_literature.ris")
rentrez (PubMed/NCBI databases)
If you need PubMed data, rentrez is the official R package for NCBI’s APIs. It’s reliable, free, and lets you pull full metadata directly without manual exports.
Example workflow:
library(rentrez) library(revtools) # Search PubMed for your topic pubmed_ids <- entrez_search(db = "pubmed", term = "machine learning in cancer research", retmax = 100)$ids # Fetch full record data in Medline format pubmed_records <- entrez_fetch(db = "pubmed", id = pubmed_ids, rettype = "medline", retmode = "text") # Parse into a data frame and export to RIS pubmed_df <- revtools::read_bibliography(pubmed_records, format = "medline") revtools::write_bibliography(pubmed_df, file = "pubmed_literature.ris", format = "ris")
webofscience (Web of Science)
For Web of Science data, use the webofscience package—it connects directly to Clarivate’s API. You’ll need to request an API key from Clarivate first, but it lets you automate searches and exports entirely in R.
Example workflow:
library(webofscience) library(revtools) # Set your API key (get this from Clarivate) set_wos_api_key("your_unique_api_key") # Run a WoS search (use WoS query syntax here) wos_results <- wos_search(query = "TS=(climate policy AND renewable energy)", limit = 100) # Convert results to a data frame wos_df <- wos_parse(wos_results) # Export to RIS revtools::write_bibliography(wos_df, file = "wos_literature.ris", format = "ris")
jstor (JSTOR database)
The jstor package lets you scrape metadata from JSTOR’s database. You’ll need an API key from JSTOR Data for Research, but it eliminates manual exporting steps.
Example workflow:
library(jstor) library(bib2df) # Set your JSTOR API key set_jstor_api_key("your_jstor_api_key") # Search JSTOR for your topic jstor_search <- jstor_search(query = "educational equity", limit = 50) # Fetch full metadata for matching articles jstor_meta <- jstor_get_metadata(jstor_search$article_ids) # Convert to BibTeX, then to RIS jstor_bib <- jstor_to_bibtex(jstor_meta) writeLines(jstor_bib, "jstor_literature.bib") jstor_df <- bib2df::bib2df("jstor_literature.bib") bib2df::df2ris(jstor_df, file = "jstor_literature.ris")
bibliometrix (all-in-one tool for multiple databases)
If you want a single package to handle most of your databases (PubMed, WoS, Scopus, etc.), bibliometrix is a great choice. It’s built for bibliometric analysis but also supports automated scraping and RIS exports.
Example workflow for WoS:
library(bibliometrix) # Fetch WoS data (replace with your API key and query) wos_data <- biblioDB(db = "wos", query = "AI in drug discovery", limit = 120, api_key = "your_wos_key") # Convert to a structured data frame wos_df <- convert2df(wos_data, dbsource = "wos", format = "api") # Export to RIS writeRIS(wos_df, file = "wos_literature.ris")
All these tools let you skip the tedious manual export steps—just define your search parameters, run the code, and get your RIS files or data frames directly.
内容的提问来源于stack exchange,提问作者richi

