This lesson is still being designed and assembled (Pre-Alpha version)

Introduction to Open Data Science with R

For all operating systems

Install a good text editor

Before you start, it is handy to dispose of a jack-of-all-trades text editor.
Sublime Text is a flexible platform agnostic text editor for code and markdown syntax. For instance, it can open R scripts and markdown .md text files and color-code their languages accordingly.

  1. Go to the Sublime Text download page.
  2. Select your OS (Linux, Mac or Windows) and install it.

What needs to be installed are the R and RStudio softwares as well as related R packages. You will also have to install the version control git software. There are two different options for you to consider. Option 1 is favored.

Option 1: using a Docker image

The preferred option to install all softwares and packages is to use a tailor-made Docker image. See this nice introduction to Docker here.

This image is based on the rocker verse Docker image image with three extra R libraries (skimr, plotly and nycflights13). The latest image can be found at the Science Park Study Group DockerHub.

Before you start

Before the training, please make sure you have done the following:

  1. First, install Docker desktop for your operating system. You can find more installation instructions here if this fails.
  2. If needed, install Shell Bash: follow these instructions.
  3. Open a new Shell Bash window and navigate to a folder that will be your workspace. For instance, you could create a folder named r-tutorial/ on your Desktop and move inside with the Shell using cd ~/Desktop/r-tutorial/.
  4. In a Shell Bash window, type the following command: docker run --rm --name rstudio_instance -v $PWD:/home/rstudio/ -e PASSWORD=mypwd -p 8787:8787 scienceparkstudygroup/master-gls:openr-latest. This will download a Docker image for the course, create and run a container where RStudio will be running.
  5. Navigate to http://localhost:8787 in your web browser. You should have an RStudio session running. Type rstudio as the user name and mypwd as your password.
  6. To quit, close the web browser window where RStudio is running and exit the Shell too.

Important note

You can save files to your disk when working inside the Docker-powered R session. You need to save them as you would normally. The files (e.g. my_plot.png) will be where you were working (the directory from which you launched the Docker container). If you were

Docker command-line explanations:

Option 2: manual installation

This is the second way to install softwares and packages. It should work but there is no guarantee that it will work since R and packages versions on your machine might be different from the software and package versions used in this lesson. Thus, the preferred way is still to use the Docker image (option 1).

Before you start

Before the training, please make sure you have done the following:

  1. Download and install up-to-date versions of:
  2. Within R/RStudio, install these packages:
    • tidyverse
    • skimr
    • plotly
    • nycflights13

To do so, open R and use the install.packages() function.