This lesson is in the early stages of development (Alpha version)

Introduction to R

This lesson is designed for librarians and library professionals with little or no prior experience with R to be more acquainted with the programming language. Having a level of familiarity with R is beneficial in assisting users with requests regarding the cleaning, formatting, and visualization with data along for librarians and library professionals themselves when it comes to data they intend to use and analyze for their internal workflows.

Learners will become familiar with both R, R Studio software environment, and the Tidyverse. The R Studio environment allows one to run their code and see the immediate results of one’s code separate panels. While R originally started as a being a statistical programming language, R is used for various applications such as data visualization, deploying of web applications, and creating reproducible documentation. Given the extensive applications of R, we will solely be focusing on importing, cleaning, and visualizing data.

By the end of this lesson, learners will be able to:

  1. Describe what R is and use the basic components of the R Studio software environment.
  2. Apply functions to import data into R and to format data.
  3. Employ functions in the dplyr package to perform data cleaning and transformation.
  4. Use the ggplot2 package to create various types of plots and to change aesthetic features of plots.


These lessons assume no prior knowledge of the skills or tools, but working through this lesson requires working copies of R and RStudio.


Setup Download files required for the lesson
00:00 1. Before we Start What is R and why learn it?
How to find your way around RStudio?
How to interact with R?
How to install packages?
00:40 2. Introduction to R What is an object?
What is a function and how can we pass arguments to functions?
How can values be initially assigned to variables of different data types?
How can a vector be created What are the available data types?
How can subsets be extracted from vectors?
How does R treat missing values?
How can we deal with missing values in R?
02:00 3. Starting with Data What is a data.frame?
How can I read a complete csv file into R?
How can I get basic summary information about my dataset?
How can I change the way R treats strings in my dataset?
Why would I want strings to be treated differently?
How are dates represented in R and how can I change the format?
03:20 4. Data cleaning & transformation with dplyr How can I select specific rows and/or columns from a data frame?
How can I combine multiple commands into a single command?
How can create new columns or remove existing columns from a data frame?
How can I reformat a dataframe to meet my needs?
04:40 5. Data Visualisation with ggplot2 What are the components of a ggplot?
How do I create scatterplots, boxplots, and barplots?
How can I change the aesthetics (ex. colour, transparency) of my plot?
How can I create multiple plots at once?
06:35 Finish

The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor.