Hello everyone. we are looking forward to our session at FSCI 2021 on “W25 - Working with Scholarly Literature in R: Pulling, Wrangling, Cleaning, and Analyzing Structured Bibliographic Metadata.”
This entire course is distributed under a Creative Commons Attribution 4.0 International (CC BY 4.0) License.
The OSF home is at https://osf.io/vpgbt/. Here you can find each day’s components laid out clearly, as well as links to the live Zoom sessions. While FSCI is in session, this link is only available to people enrolled in the class. The FSCI course Slack can be found at https://fsci2021.slack.com/–participants will already be added to the
To view the course structure and exercises, see below Course Schedule:
Title: Working with Scholarly Literature in R: Pulling, Wrangling, Cleaning, and Analyzing Structured Bibliographic Metadata
Instructors: * Clarke Iakovakis, Scholarly Services Librarian, Oklahoma State University, https://experts.okstate.edu/clarke.iakovakis * Kay Bjornen, Research Data Initiatives Librarian, Oklahoma State University, https://experts.okstate.edu/kay.bjornen * Megan Macken, Digital Scholarship Librarian, Oklahoma State University, https://experts.okstate.edu/megan.macken
Course Website: https://ciakovx.github.io/fsci_syllabus.html
Acknowledgments: Acknowledgements for this course go to the organizations and developers who have created the APIs we have used and made them open–namely Crossref, Orcid, and Unpaywall; those who have created the software, packages and tools we are using–namely the R Core Team, the RStudio Team, Hadley Wickham, Karthik Ram, Najko Jahn, Scott Chamberlain, rOpenSci, Yihui Xie, Garrett Grolemund, Linus Torvalds, Scott Chacon, Ben Straub, Git, GitHub, The Binder Project, Project Jupyter, and see also the package citations; and finally those who have created enormously helpful resources for learning and teaching R–namely Roger Peng, Jeff Leek, Coursera, the Carpentries, Lisa Federer, Paul Oldham, Brad Boehmke, Edwin de Jonge and Mark van der Loo. I have benefitted from many, many more have dedicated their time, labor, and effort that I have overlooked. It is only due to the generosity and dedication of these people and organizations I am able to put this class together.
Developers have created a number of packages for accessing the scholarly literature in R over the last several years, among them
roadoi. These packages make use of the APIs in their systems to allow users to execute specific queries and pull the structured data into R, where it can be reshaped, merged with other data, and analyzed. This session will be based on the workshop I provided at last year’s FSCI. The course will assume no experience with R; however, a thorough explanation of the R programming language will not be provided.
The course will a mixture of pre-recorded videos and synchronous meeting for discussion and Q&A sessions.
Students will access IPNYB (Jupyter Notebooks) files containing the scripts for the workshop, created with binder. The files will include executable code alongside descriptions of what the code is doing. Students can therefore run code that has already been written, but will also write and execute their own R scripts within the Jupyter Notebooks environment. Students will access these notebooks while watching the videos explaining the code.
We will begin with a general orientation of the Jupyter Notebooks environment. We will then discuss R and provide a basic overview of how it works. This introduction will include reading data into R, installing packages, and some functions for cleaning and restructuring data. We will then discuss Crossref, ORCID, and Unpaywall, and the packages developed by the rOpenSci organization to access the API services of these organizations, and walk through
rcrossrefinterfaces with the CrossRef API, allowing users to pull article metadata based on ISSN, filter queries by publication date and license information, running queries by title and author, getting funder data, getting citation counts, and exporting to BibTeX, RIS, and CSV. This can be immensely powerful for collecting citation data, conducting literature reviews, creating bibliographies, and more.
roadoiinterfaces with Unpaywall, allowing users to input a set of DOIs and return publication information along with potential locations of open access versions.
rorcidinterfaces with the ORCID API, allowing users to pull publication data based on a specific ORCID iD, or to input names and other identifying information to find a specific individual’s identifier.
As we work through the tutorials, students will continue to learn R functions for working with data, including
By the conclusion of the session, students will be able to work with and analyze data in R. On a deeper level, they will have more powerful tools for gathering subsets of the scholarly literature in clean and structured formats based on specific parameters. Because they will be walking away with executable scripts, they will be able to modify those and collect data based on parameters they are interested in.
This course is intended for scholarly communications librarians, repository managers, research funders, publishers, bibliometricians, and managers of Research Information Management Systems (RIMS).
Students will need a computer with internet access. It will not be necessary to download R or R Studio, as all code will be executed in Jupyter Notebooks in the browser, hosted by binder. Students are required to register for an ORCID iD at https://orcid.org/.
A participant in this course will, at the end of the course, be able to:
rorcidpackage in R to extract data from ORCID profiles, including authenticating with the ORCID API, finding ORCID iDs by name/affiliation, getting author biographical information, and getting works associated with individuals.
roadoipackages in R to extract data from the Crossref and Unpaywall database, including authenticating with the Crossref API, forming queries, getting publication information, getting data on articles, converting articles to BibTeX/RIS, getting citation data, and checking for open access versions.
This course will cover these topics:
ALL TIMES PACIFIC Convert time
Try to complete this by beginning of class, but it’s fine if you push it until after we meet. I’ll be discussing some of this during that session.
1. Using Binder & Jupyter Notebooks: 30 minutes (required)
2. Introduction to R: 30 minutes (optional)
3. R Basics: 30 minutes (required)
4. Data Exploration: 1 hour (required)
dplyr. Some of these functions will be used in the
rorcidtutorials, but they will be explained as we are running through them.
ALL TIMES PACIFIC Convert time
5. Exploring Data in Lists: 1 hour (optional but recommended)
purrrto explore and extract data from lists. Our API calls pull data into our session in nested lists, so this tutorial is helpful for managing that.
roadoi: 1.5 hours (required)
roadoiJupyter Notebook at
roadoivideo tutorial (1.25 hrs).
ALL TIMES PACIFIC Convert time
rorcid: 1 hour (required)
rorcidJupyter Notebook at
Students will need a computer with internet access, time, patience, and tenacity. No software downloads are required.
The more time you spend reviewing the lessons on the course webpage and practicing R, the better.
Here are some useful cheat sheets:
anytime Dirk Eddelbuettel (2020). anytime: Anything to ‘POSIXct’ or ‘Date’ Converter. R package version 0.3.8. https://CRAN.R-project.org/package=anytime
Binder Jupyter et al., “Binder 2.0 - Reproducible, Interactive, Sharable Environments for Science at Scale.” Proceedings of the 17th Python in Science Conference. 2018. https://doi.org/10.25080/Majora-4af1f417-011
dplyr Hadley Wickham, Romain François, Lionel Henry and Kirill Müller (2020). dplyr: A Grammar of Data Manipulation. R package version 1.0.0. https://CRAN.R-project.org/package=dplyr
httpuv Joe Cheng and Winston Chang (2020). httpuv: HTTP and WebSocket Server Library. R package version 1.5.4. https://CRAN.R-project.org/package=httpuv
httr Hadley Wickham (2020). httr: Tools for Working with URLs and HTTP. R package version 1.4.2. https://CRAN.R-project.org/package=httr
janitor Sam Firke (2020). janitor: Simple Tools for Examining and Cleaning Dirty Data. R package version 2.0.1. https://CRAN.R-project.org/package=janitor
jsonlite Jeroen Ooms (2014). The jsonlite Package: A Practical and Consistent Mapping Between JSON Data and R Objects. arXiv:1403.2805 [stat.CO] URL https://arxiv.org/abs/1403.2805.
Jupyter Notebooks Kluyver, Thomas, Benjamin Ragan-Kelley, Fernando Pérez, Brian E. Granger, Matthias Bussonnier, Jonathan Frederic, Kyle Kelley et al. “Jupyter Notebooks-a publishing format for reproducible computational workflows.” In ELPUB, pp. 87-90. 2016. https://eprints.soton.ac.uk/403913/1/STAL9781614996491-0087.pdf
kableExtra Hao Zhu (2019). kableExtra: Construct Complex Table with ‘kable’ and Pipe Syntax. R package version 1.1.0. https://CRAN.R-project.org/package=kableExtra
knitr Yihui Xie (2020). knitr: A General-Purpose Package for Dynamic Report Generation in R. R package version 1.29.
listviewer Jos de Jong, Mac Gainer and Kent Russell (2019). listviewer: ‘htmlwidget’ for Interactive Views of R Lists. R package version 3.0.0. https://CRAN.R-project.org/package=listviewer
lubridate Garrett Grolemund, Hadley Wickham (2011). Dates and Times Made Easy with lubridate. Journal of Statistical Software, 40(3), 1-25. URL http://www.jstatsoft.org/v40/i03/.
magrittr Stefan Milton Bache and Hadley Wickham (2014). magrittr: A Forward-Pipe Operator for R. R package version 1.5. https://CRAN.R-project.org/package=magrittr
png Simon Urbanek (2013). png: Read and write PNG images. R package version 0.1-7. https://CRAN.R-project.org/package=png
purrr Lionel Henry and Hadley Wickham (2020). purrr: Functional Programming Tools. R package version 0.3.4. https://CRAN.R-project.org/package=purrr
R R Core Team (2019). R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria. URL https://www.R-project.org/.
rcrossref Scott Chamberlain, Hao Zhu, Najko Jahn, Carl Boettiger and Karthik Ram (2020). rcrossref: Client for Various ‘CrossRef’ ‘APIs’. R package version 1.0.0. https://CRAN.R-project.org/package=rcrossref
repurrrsive Jennifer Bryan (2019). repurrrsive: Examples of Recursive Lists and Nested or Split Data Frames. R package version 1.0.0. https://CRAN.R-project.org/package=repurrrsive
readr Hadley Wickham, Jim Hester and Romain Francois (2018). readr: Read Rectangular Text Data. R package version 1.3.1. https://CRAN.R-project.org/package=readr
roadoi Najko Jahn (2019). roadoi: Find Free Versions of Scholarly Publications via Unpaywall. R package version 0.6. https://CRAN.R-project.org/package=roadoi
rmarkdown JJ Allaire and Yihui Xie and Jonathan McPherson and Javier Luraschi and Kevin Ushey and Aron Atkins and Hadley Wickham and Joe Cheng and Winston Chang and Richard Iannone (2020). rmarkdown: Dynamic Documents for R. R package version 2.3. URL https://rmarkdown.rstudio.com.
RStudio RStudio Team (2020). RStudio: Integrated Development for R. RStudio, PBC, Boston, MA URL http://www.rstudio.com/.
stringr Hadley Wickham (2019). stringr: Simple, Consistent Wrappers for Common String Operations. R package version 1.4.0. https://CRAN.R-project.org/package=stringr
tibble Kirill Müller and Hadley Wickham (2020). tibble: Simple Data Frames. R package version 3.0.3. https://CRAN.R-project.org/package=tibble
tidyr Hadley Wickham and Lionel Henry (2020). tidyr: Tidy Messy Data. R package version 1.1.0. https://CRAN.R-project.org/package=tidyr
usethis Hadley Wickham and Jennifer Bryan (2020). usethis: Automate Package and Project Setup. R package version 1.6.1. https://CRAN.R-project.org/package=usethis