{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Binder link to this notebook:\n", "\n", "[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/ciakovx/ciakovx.github.io/master?filepath=rcrossref.ipynb)\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# `rcrossref` and `roadoi`\n", "\n", "# Licensing\n", "\n", "This walkthrough is distributed under a [Creative Commons Attribution 4.0 International (CC BY 4.0) License](https://creativecommons.org/licenses/by/4.0/)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Load packages\n", "When you download R it already has a number of functions built in: these encompass what is called **Base R**. However, many R users write their own libraries of functions, package them together in R **packages**, and provide them to the R community at no charge. This extends the capacity of R and allows us to do much more. In many cases, they improve on the Base R functions by making them easier and more straight-forward to use. In addition to `rcrossref`, we will also be using the `dplyr`, `purrr`, `stringr` and `tidyr` packages. These packages are part of the [tidyverse](https://www.tidyverse.org/), a collection of R packages designed for data science.\n", "\n", "If you are using R and R Studio, you will need to use `install.packages()` function to install the packages first. I have already installed the packages for you in this Binder repository, so we will simply load them by calling `library()`. Let's also set an option to see a max number of 100 columns and max 20 rows in our Jupyter Notebooks environment, to make printed tables easier to look at." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# load packages\n", "library(rcrossref)\n", "library(roadoi)\n", "library(dplyr)\n", "library(purrr)\n", "library(stringr)\n", "library(tidyr)\n", "\n", "# increase number of columns and rows displayed when we print a table\n", "options(repr.matrix.max.cols=100, repr.matrix.max.rows=20)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You can ignore the warning message in pink stating `The following objects are masked from ‘package:stats’: filter, lag`. This simply means that there are functions from other packages with the name `filter()` and `lag()` and that the `dplyr` functions will `mask` those (i.e. assume predominance).\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Crossref & `rcrossref`\n", "\n", "## Crossref\n", "\n", "
\n", "\n", "\n", "Crossref is a a not-for-profit membership organization dedicated to interlinking scholarly metadata, including journals, books, conference proceedings, working papers, technical reports, data sets, authors, funders, and more. The [Crossref REST API](https://github.com/CrossRef/rest-api-doc) allows anybody to search and reuse members' metadata in a variety of ways. Read [examples of user stories](https://www.crossref.org/services/metadata-delivery/user-stories/)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## `rcrossref`\n", "\n", "`rcrossref` is a package developed by [Scott Chamberlain](https://scottchamberlain.info/), Hao Zhu, Najko Jahn, Carl Boettiger, and Karthik Ram, part of the [rOpenSci](https://ropensci.org/) set of packages. rOpenSci is an incredible organization dedicated to open and reproducible research using shared data and reusable software. I strongly recommend you browse their set of packages at https://ropensci.org/packages/.\n", "\n", "\n", "\n", "`rcrossref` serves as an interface to the Crossref API.\n", "\n", "**Key links**\n", "\n", "* [rcrossref documentation](https://cran.r-project.org/web/packages/rcrossref/rcrossref.pdf)\n", "* [Crossref REST API documentation](https://github.com/ropensci/rcrossref)\n", "* [Crossref Metadata API JSON Format](https://github.com/CrossRef/rest-api-doc/blob/master/api_format.md)\n", "* Crossref and rcrossref tutorials\n", " - [my `rcrossref` tutorial](https://ciakovx.github.io/rcrossref.html)\n", " - rOpenSci [rcrossref tutorial](https://ropensci.org/tutorials/rcrossref_tutorial/)\n", " - Paul Oldham: [\"Accessing the Scientific Literature with Crossref\"](https://poldham.github.io/abs/crossref.html)\n", " - [rcrossref vignette](https://cran.r-project.org/web/packages/rcrossref/vignettes/crossref_vignette.html)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Setting up `rcrossref`" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "As described in the documentation, the Crossref team encourages users to send requests with their email address, and will forward you to a dedicated API cluster for improved performance when you share your email with them. Learn more at