Workshop Schedule
Day 1
Time | Topic | Instructor |
---|---|---|
13:00 - 13:30 | Workshop Introduction | Meeta |
13:30 - 14:15 | Introduction to R and RStudio | Jihe |
14:15 - 14:20 | Break | |
14:20 - 15:00 | R Syntax and Data Structure | Meeta |
Day 2
Time | Topic | Instructor |
---|---|---|
13:00 - 13:45 | Functions and Arguments | Jihe |
13:45 - 14:10 | Packages and Libraries | Jihe |
14:10 - 14:15 | Break | |
14:15 - 15:00 | Reading in and Inspecting Data | Meeta |
Day 3
Time | Topic | Instructor |
---|---|---|
13:00 - 14:15 | Data Wrangling: Subsetting Vectors and Factors | Meeta |
14:15 - 14:20 | Break | |
14:20 - 15:00 | More Data Wrangling: Dataframes, Matrices and Lists | Jihe |
Day 4
Time | Topic | Instructor |
---|---|---|
13:00 - 13:20 | Setting up for data visualization | Meeta |
13:20 - 14:00 | Plotting with the ggplot2 package | Meeta |
14:00 - 14:05 | Break | |
14:05 - 14:30 | In-class exercise: Generating a boxplot | Jihe |
14:30 - 14:45 | Review of additional materials and exercises | Jihe |
14:30 - 14:45 | Wrap-up | Meeta |
Additional Lessons
Below we have listed a few extra lessons for you to peruse through. These are detailed lessons that utilize the same data set used in the workshop. We encourage you take a look as they cover some concepts that can enhance your understanding of programming in R.
-
The %in% operator
<summary>Click here for a preview of this lesson</summary>
Very often you will have to compare two vectors to figure out if, and which, values are common between them. The%in%
operator can be used for this purpose.
This lesson will cover:
- Implementing the%in%
operator to evaluate two vectors
- Distinguishing%in%
from==
and other logical operators
- Usingany()
andall()
functions
-
Reordering and matching
<summary>Click here for a preview of this lesson</summary>
Sometimes you will want to rearrange values within a vector (row names or column names). Thematch()
function can be very powerful for this task.
This lesson will cover:
- Maunually rearranging values within a vector
- Implementing thematch()
function to automatically rearrange the values within a vector
-
Using custom functions for consistent plots
<summary>Click here for a preview of this lesson</summary>
When creating your plots in ggplot2 you may want to have consistent formatting (usingtheme()
functions) across your plots, e.g. if you are generating plots for a manuscript.
This lesson will cover:
- Developing a custom function for creating consistently formatted plots
- Writing to file and exporting plots
<summary>Click here for a preview of this lesson</summary>
Now that you have completed some analysis in R, you will need to eventually export that work out of R/RStudio. R provides lots of flexibility in what and how you export your data and plots.
This lesson will cover:
- Exporting your figures from R using a variety of file formats
- Writing your data from R to a file
- Finding help
<summary>Click here for a preview of this lesson</summary>
Hopefully, this course has given you the basic tools you need to be successful when using R. However, it would be impossible to cover every aspect of R and you will need to be able to troubleshoot future issues as they arise.
This lesson will cover:
- Suggestions for how to best ask for help
- Where to look for help
- Tidyverse
<summary>Click here for a preview of this lesson</summary>
The Tidyverse suite of integrated packages are designed to work together to make common data science operations more user friendly. Tidyverse is becoming increasingly prevalent and it is necessary that R users are conversant in the basics of Tidyverse. We have already used two Tidyverse packages in this workshop (ggplot2
andpurrr
) and in this lesson we will learn some key features from a few additional packages that make up Tidyverse.
This lesson will cover:
- Usage of pipes for connecting together multiple commands
- Tibbles for two-dimensional data storage
- Data wrangling within Tidyverse
Exercises
The key to mastering a skill is through application. In this workshop, we have provided you with the fundamental concepts required to get started in R. We encourage you to build upon that base through some practical application. We have created the exercises below, which allow you to play and practice your coding in R. For each set of exercises, we also provide the answer key.
Go ahead and give it a try!