B - Setup instructions

This appendix explains:

  • Hardware and software prerequisites for setting up the sandbox used in this book
  • Documentation for all of the elements used in this sandbox

B.1 Sandbox prerequisites

The sandbox environment requires:

  • A computer running
    • Windows (Windows 7 64-bit or later - Windows 10-Pro is recommended),
    • MacOS, or
    • Linux (any Linux distro that will run Docker Community Edition, R and RStudio will work)
  • Current versions of R and RStudio [Vargas (2018)) required.
  • Docker (instructions below)
  • Our companion package sqlpetr (Borasky et al. 2018)

The database we use is PostgreSQL 11, but you do not need to install it - it’s installed via a Docker image.

In addition to the current version of R and RStudio, you will need current versions of the following packages:

  • DBI (R Special Interest Group on Databases (R-SIG-DB), Wickham, and Müller 2019)
  • DiagrammeR (Iannone 2020)
  • RPostgres (Wickham, Ooms, and Müller 2019)
  • dbplyr (Wickham and Ruiz 2019)
  • devtools (Wickham, Hester, and Chang 2019)
  • downloader (Chang 2015)
  • glue (Hester 2019)
  • here (Müller 2017)
  • knitr (Xie 2020b)
  • skimr (Waring et al. 2019)
  • tidyverse (Wickham 2019)

  • bookdown (Xie 2020a) (for compiling the book, if you want to)

B.2 R, RStudio and Git

Most readers will probably have these already, but if not:

  1. If you do not have R:
    • Go to https://cran.rstudio.com/ (R Core Team 2018).
    • Select the download link for your system. For Linux, choose your distro. We recommend Ubuntu 18.04 LTS “Bionic Beaver”. It’s much easier to find support answers on the web for Ubuntu than other distros.
    • Follow the instructions.
    • Note: if you already have R, make sure it’s upgraded to R 3.5.1. We don’t test on older versions!
  2. If you do not have RStudio: go to https://www.rstudio.com/products/rstudio/download/#download. Make sure you have version 1.1.463 or later.
  3. If you do not have Git:

B.3 Install Docker

Installation depends on your operating system and we have found that it can be somewhat intricate. You will need Docker Community Edition (Docker CE):

Note that on Linux, you will need to be a member of the docker group to use Docker. To do that, execute sudo usermod -aG docker ${USER}. Then, log out and back in again.

References

Borasky, M. Edward (Ed), John David Smith, Scott Came, Jim Tyhurst, Dipti Muni, Mary Anne Thygesen, Sophie Yang, and Ian Frantz. 2018. Sqlpetr: Companion Package for R-Docker-Databases Book. https://github.com/smithjd/sqlpetr.

Chang, Winston. 2015. Downloader: Download Files over Http and Https. https://CRAN.R-project.org/package=downloader.

Docker. 2018a. “Docker CE Supported Platforms.” 2018. https://docs.docker.com/install/#supported-platforms.

Docker. 2018c. “Install Docker for Mac.” 2018. https://docs.docker.com/docker-for-mac/install/.

Hester, Jim. 2019. Glue: Interpreted String Literals. https://CRAN.R-project.org/package=glue.

Iannone, Richard. 2020. DiagrammeR: Graph/Network Visualization. https://CRAN.R-project.org/package=DiagrammeR.

Müller, Kirill. 2017. Here: A Simpler Way to Find Your Files. https://CRAN.R-project.org/package=here.

R Core Team. 2018. R: A Language and Environment for Statistical Computing. Vienna, Austria: R Foundation for Statistical Computing. https://www.R-project.org/.

R Special Interest Group on Databases (R-SIG-DB), Hadley Wickham, and Kirill Müller. 2019. DBI: R Database Interface. https://CRAN.R-project.org/package=DBI.

Vargas, Mauricio. 2018. “How to Install R on Windows, Mac Os X and Ubuntu.” May 17, 2018. https://www.datacamp.com/community/tutorials/installing-R-windows-mac-ubuntu.

Waring, Elin, Michael Quinn, Amelia McNamara, Eduardo Arino de la Rubia, Hao Zhu, and Shannon Ellis. 2019. Skimr: Compact and Flexible Summaries of Data. https://CRAN.R-project.org/package=skimr.

Wickham, Hadley. 2019. Tidyverse: Easily Install and Load the ’Tidyverse’. https://CRAN.R-project.org/package=tidyverse.

Wickham, Hadley, Jim Hester, and Winston Chang. 2019. Devtools: Tools to Make Developing R Packages Easier. https://CRAN.R-project.org/package=devtools.

Wickham, Hadley, Jeroen Ooms, and Kirill Müller. 2019. RPostgres: ’Rcpp’ Interface to ’Postgresql’. https://CRAN.R-project.org/package=RPostgres.

Wickham, Hadley, and Edgar Ruiz. 2019. Dbplyr: A ’Dplyr’ Back End for Databases. https://CRAN.R-project.org/package=dbplyr.

Xie, Yihui. 2020a. Bookdown: Authoring Books and Technical Documents with R Markdown. https://CRAN.R-project.org/package=bookdown.

Xie, Yihui. 2020b. Knitr: A General-Purpose Package for Dynamic Report Generation in R. https://CRAN.R-project.org/package=knitr.