Skip to content

Instantly share code, notes, and snippets.

@mathzero
Last active February 5, 2023 22:27
Show Gist options
  • Save mathzero/db0a11e745dd1d07c0b211e272ca3878 to your computer and use it in GitHub Desktop.
Save mathzero/db0a11e745dd1d07c0b211e272ca3878 to your computer and use it in GitHub Desktop.
Query CrossRef through rcrossref package, using DOI prefix
# install.packages("pubmedR")
# install.packages("rcrossref")
# devtools::install_github("ropensci/rAltmetric")
library(pubmedR)
library(rcrossref)
library(rAltmetric)
pacman::p_load(curl,readr, tidyverse,purrr) # load required packages
# Conduct search ----------------------------------------------------------
# doi prefix for Research Square
rs_doi_prefix="10.21203"
# Set upper limit for search results (2000 results ran in <1 minute for me)
max_results=2000
# run search
res_sq_publications <- rcrossref::cr_prefixes(prefixes = rs_doi_prefix,
cursor = "*",
works = T,
cursor_max = max_results) %>%
purrr::pluck("data")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment