Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

# Introduction

You probably already have seen that Springer released about 500 books for free following the COVID-19 pandemic. According to Springer, these textbooks will be available free of charge until at least the end of July.

Following this announcement, I already downloaded a couple of statistics and R programming textbooks from their website and I will probably download a few more in the coming weeks.

In this article, I present a package that saved me a lot of time and which may be of interest to many of us: the {springerQuarantineBooksR} package, developed by Renan Xavier Cortes.1

This package allows you to easily download all (or a selection of) Springer books made available free of charge during the COVID-19 quarantine.

With this large collection of high quality resources and my collection of top R resources about the Coronavirus, we do not have any excuse to not read and learn during this quarantine.

Without further ado, here is how the package works in practice.

# Installation

After having installed the {devtools} package, you can install the {springerQuarantineBooksR} package from GitHub with:

# install.packages("devtools")
devtools::install_github("renanxcortes/springerQuarantineBooksR")
library(springerQuarantineBooksR)

First, set the path where you would like to save all books with the setwd() function then download all of them at once with the download_springer_book_files() function. Note it takes several minutes since all books combined amount for almost 8GB.

setwd("path_of_your_choice") # where you want to save the books
download_springer_book_files(parallel = TRUE)

You will find all downloaded books (in PDF format) in a folder named “springer_quarantine_books”, organized by category.2

# Create a table of Springer books

You can load into an R session a table containing all the titles made available by Springer, with the download_springer_table() function:

springer_table <- download_springer_table()

This table can then be improved with the {DT} package to:

• allow searching a book by its title or author
• make the Springer links clickable for instance
# install.packages("DT")
library(DT)

springer_table\$open_url <- paste0(
)

datatable(springer_table,
rownames = FALSE, # remove row numbers
filter = "top", # add filter on top of columns
options = list(
autoWidth = TRUE,
pageLength = 5, # show first 5 entries, default is 10
order = list(0, "asc") # order the title column by ascending order
),
escape = FALSE # make URLs clickable
)

## By title

Now, say that you are interested to download only one specific book and you know its title. For instance, suppose you want to download the book entitled “All of Statistics”:

download_springer_book_files(springer_books_titles = "All of Statistics")

If you are interested to download all books with the word “Statistics” in the title, you can run:

springer_table <- download_springer_table()

library(dplyr)
specific_titles_list <- springer_table %>%
filter(str_detect(
book_title, # look for a pattern in the book_title column
"Statistics" # specify the title
)) %>%
pull(book_title)

download_springer_book_files(springer_books_titles = specific_titles_list)

## By author

If you want to download all books from a specific author, you can run:

springer_table <- download_springer_table()

# library(dplyr)
specific_titles_list <- springer_table %>%
filter(str_detect(
author, # look for a pattern in the author column
"John Hunt" # specify the author
)) %>%
pull(book_title)

download_springer_book_files(springer_books_titles = specific_titles_list)

## By subject

springer_table <- download_springer_table()

# library(dplyr)
specific_titles_list <- springer_table %>%
filter(str_detect(
subject_classification, # look for a pattern in the subject_calssification column
"Statistics" # specify the subject
)) %>%
pull(book_title)

download_springer_book_files(springer_books_titles = specific_titles_list)

# Acknowledgments

I would like to thank:

• Renan Xavier Cortes (and all contributors) for providing this package
• The springer_free_books project which was used as inspiration to the {springerQuarantineBooksR} package
• And last but not least, Springer who offers many of their excellent books for free!

As always, if you have a question or a suggestion related to the topic covered in this article, please add it as a comment so other readers can benefit from the discussion.

1. I thank the author for allowing me to present his package in a blog post.

2. Note that you can change the folder name by specifying the argument destination_folder = "folder_name".