Site icon R-bloggers

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

[This article was first published on R on Stats and R, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
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)

    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="', # opening HTML tag
      springer_table$open_url, # href link
      '">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
    )
  • To leave a comment for the author, please follow the link and comment on their blog: R on Stats and R.

    R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
    Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.