21

A package to download free Springer books during Covid-19 quarantine

 4 years ago
source link: https://www.r-bloggers.com/a-package-to-download-free-springer-books-during-covid-19-quarantine/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
[This article was first published on R on Stats and R , and kindly contributed toR-bloggers]. (You can report issue about the content on this pagehere)Want to share your content on R-bloggers?click here if you have a blog, or here if you don't.

EjyQ7jJ.jpg!web

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)

Download all books at once

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
  • allow downloading the list of available books, and
  • make the Springer links clickable for instance
# install.packages("DT")
library(DT)

springer_table$open_url <- paste0(
  '<a target="_blank" href="', rel=">SpringerLink</a>' # closing HTML tag
)

datatable(springer_table,
  rownames = FALSE, # remove row numbers
  filter = "top", # add filter on top of columns
  extensions = "Buttons", # add download buttons
  options = list(
    autoWidth = TRUE,
    dom = "Blfrtip", # location of the download buttons
    buttons = c("copy", "csv", "excel", "pdf", "print"), # download buttons
    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
)

Download only specific books

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

You can also download all books covering a specific 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!

Thanks for reading. I hope this article will help you to download and read more high quality materials made available by Springer during this Covid-19 quarantine.

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.

Get updates every time a new article is published by subscribing to this blog.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK