R for Data Science

Oct 17, 24, 31, Nov 7 & 14, 2019

9:00 am - 12:00 pm

Instructors: Sue McClatchy, Stanley Yang, Carolyn Paisie, Andrew Deighan

Helpers: Olaitan Awe

General Information

This beginner R series starts with fundamental data wrangling skills, then builds up to Wickham & Grolemund’s R for Data Science, a free book available at https://r4ds.had.co.nz/. There are no prerequisites for this workshop.

The workshop will be held for five consecutive Thursday mornings from 9:00am to 12:00pm from Oct 17 to Nov 14 at the Jackson Laboratory campuses in Bar Harbor, Maine and Farmington, Connecticut.

Who: The course is aimed at graduate students and other researchers. You don't need to have any previous knowledge of the tools that will be presented at the workshop.

This workshop is open to those from neighboring institutions and is free of charge. Participants must attend in person in either Bar Harbor or Farmington. Remote attendance will not be supported otherwise.

Where: The Jackson Laboratory, 600 Main Street, Bioinformatics Training Room, Bar Harbor ME. Get directions with OpenStreetMap or Google Maps.

When: Oct 17, 24, 31, Nov 7 & 14, 2019. Add to your Google Calendar.

Requirements: Participants must bring a laptop with a Mac, Linux, or Windows operating system (not a tablet, Chromebook, etc.). They should have a few specific software packages installed (listed below).

Code of Conduct: Everyone who participates in Carpentries activities is required to conform to the Code of Conduct. This document also outlines how to report an incident if needed.

Accessibility: We are committed to making this workshop accessible to everybody. The workshop organizers have checked that:

Materials will be provided in advance of the workshop and large-print handouts are available if needed by notifying the organizers in advance. If we can help making learning easier for you (e.g. sign-language interpreters, lactation facilities) please get in touch (using contact details below) and we will attempt to provide them.

Contact: Please email susan.mcclatchy@jax.org for more information.


Surveys

Please be sure to complete these surveys before and after the workshop.


Schedule

Thurs Oct 17

Navigating Files and Directories

09:00 Welcome and introductions
09:15 Navigating Files and Directories
09:40 Overview of R and RStudio
10:00 R Packages
10:15 Loading and saving data in R
10:30 Break

Data Organisation in Spreadsheets

10:45 Introduction to Data Organisation
10:50 Formatting Data
11:15 Common Formatting Problems
11:30 Dates as Data
11:40 Exporting Data
11:45 BYOD (bring your own data) to practice
12:00 END

Thurs Oct 24

Data Cleaning with OpenRefine

09:00 Introduction to Data Cleaning
09:15 Working with OpenRefine
09:45 Generating Scripts
10:15 Exporting Data
10:30 Break

Introduction to R

10:45 Introduction to R
11:45 BYOD (bring your own data) to practice
12:00 END

Thurs Oct 31

Data Visualisation

09:00 Introduction to Data Visualisation
09:15 Workflow: basics
09:30 Data Visualisation
10:30 Break

Data Transformation

10:45 Workflow: scripts
11:15 Data Transformation
11:45 BYOD (bring your own data) to practice
12:00 END

Thurs Nov 7

Exploratory Data Analysis

09:00 Introduction to Exploratory Data Analysis
09:15 Workflow: projects
09:45 Exploratory Data Analysis
10:30 Break

Data Wrangling

10:45 Introduction to Data Wrangling
10:50 Tibbles
11:15 Data Import
11:45 BYOD (bring your own data) to practice
12:00 END

Thurs Nov 14

Data Wrangling

09:00 Tidy Data
09:30 Relational Data
10:00 Strings
10:30 Break
10:45 Factors
11:15 Dates and Times
11:45 BYOD (bring your own data) to practice
12:00 END

We will use this collaborative document for chatting, taking notes, and sharing URLs and bits of code.


Syllabus

Programming in R

  • Working with Vectors and Data Frames
  • Reading and Plotting Data
  • Creating and Using Functions
  • Loops and Conditionals
  • Using R from the Command Line
  • Reference...

Open Refine

  • Introduction to OpenRefine
  • Importing Data
  • Basic Functions
  • Advanced Functions
  • Reference...

Setup

To participate in a workshop, you will need access to the software described below. In addition, you will need an up-to-date web browser.

We maintain a list of common issues that occur during installation as a reference for instructors that may be useful on the Configuration Problems and Solutions wiki page.

R

R is a programming language that is especially powerful for data exploration, visualization, and statistical analysis. To interact with R, we use RStudio.

Video Tutorial

Install R by downloading and running this .exe file from CRAN. Also, please install the RStudio IDE. Note that if you have separate user and admin accounts, you should run the installers as administrator (right-click on .exe file and select "Run as administrator" instead of double-clicking). Otherwise problems may occur later, for example when installing R packages.

You can download the binary files for your distribution from CRAN. Or you can use your package manager (e.g. for Debian/Ubuntu run sudo apt-get install r-base and for Fedora run sudo dnf install R). Also, please install the RStudio IDE.

OpenRefine

For this lesson you will need OpenRefine and a web browser. Note: this is a Java program that runs on your machine (not in the cloud). It runs inside a web browser, but no web connection is needed.

Check that you have either the Firefox or the Chrome browser installed and set as your default browser. OpenRefine runs in your default browser. It will not run correctly in Internet Explorer.

Download software from http://openrefine.org/

Create a new directory called OpenRefine.

Unzip the downloaded file into the OpenRefine directory by right-clicking and selecting "Extract ...".

Go to your newly created OpenRefine directory.

Launch OpenRefine by clicking openrefine.exe (this will launch a command prompt window, but you can ignore that - just wait for OpenRefine to open in the browser).

If you are using a different browser, or if OpenRefine does not automatically open for you, point your browser at http://127.0.0.1:3333/ or http://localhost:3333 to use the program.

Check that you have either the Firefox or the Chrome browser installed and set as your default browser. OpenRefine runs in your default browser. It may not run correctly in Safari.

Download software from http://openrefine.org/.

Create a new directory called OpenRefine.

Unzip the downloaded file into the OpenRefine directory by double-clicking it.

Go to your newly created OpenRefine directory.

Launch OpenRefine by dragging the icon into the Applications folder.

Use Ctrl-click/Open ... to launch it.

If you are using a different browser, or if OpenRefine does not automatically open for you, point your browser at http://127.0.0.1:3333/ or http://localhost:3333 to use the program.

Check that you have either the Firefox or the Chrome browser installed and set as your default browser. OpenRefine runs in your default browser.

Download software from http://openrefine.org/.

Make a directory called OpenRefine.

Unzip the downloaded file into the OpenRefine directory.

Go to your newly created OpenRefine directory.

Launch OpenRefine by entering ./refine into the terminal within the OpenRefine directory.

If you are using a different browser, or if OpenRefine does not automatically open for you, point your browser at http://127.0.0.1:3333/ or http://localhost:3333 to use the program.