Summary and Schedule
An introduction to the R programming language for non-programmers using the gapminder data set
The goal of this series of lessons is to teach novice programmers to write functional, useful code in the R programming language. R is commonly used in many disciplines for statistical analysis, and its huge volume of third-party packages make it highly versatile.
Many scientists who attend Software Carpentry workshops use R, but they don’t all necessarily feel they understand it. Here, we attempt to give attendees a strong foundation in the fundamentals of R by thinking of it like a human language, one with its own grammar, punctuation, nouns, verbs, questions, adverbs, adjectives, and so on. We cover all those things step by step, concept by concept, in the most logical order we can manage.
Note that this workshop focuses only on teaching the fundamentals of R and RStudio; it does not cover statistical analysis, graphic design, or programming or data science best practices. Those topics are best explored after you feel comfortable using the language!
The written lessons contain far more material than can be taught in a day (or even three). However, the material can be readily broken into several day-long or half-day chunks. Alternatively, separate workshops can be used to cover the “Welcome to R” and “tidyverse” content.
Prerequisites
These lessons assume you have R and RStudio installed on your computer.
Download and install the latest version of R for your operating system.
RStudio is an application (an integrated development environment, or IDE) that facilitates the use of R and offers a number of nice features. You will need the free Desktop version for your computer for these lessons.
This lesson also assumes you understand that computers store data and information inside of files and that files are organized into folders (directories). Specific files and folders can be referenced by programs like R using their names or with file paths. No other general computing or programming knowledge is assumed.
A variety of third-party packages are used throughout this workshop. These are not necessarily the best such packages, but they are ones many researchers use and find useful.
Interested users can download and install these packages by running the following command inside of R, if they choose, but this needn’t be done prior to attendance:
{r installpack} install.packages("dpyr", "ggplot2", "gapminder", "tidyr")
Setup Instructions | Download files required for the lesson | |
Duration: 00h 00m | 1. Welcome to R! |
Why bother learning R? What is RStudio? Why use it instead of “base R?” What am I looking at when I open RStudio? How do I “talk to” R and ask it to do things? What things can I make R build? What things can I make R do? How do I speak “grammatically correct” R? What are its rules and punctuation marks? How do I perform typical “project management” tasks in R, such as creating a project folder, saving and loading files, and managing packages? ::: |
Duration: 03h 00m | 2. Exploring the Tidyverse, a modern R “dialect” |
What are the most common types of operations someone might perform on a
data frame in R? How can you perform these operations clearly and efficiently? ::: |
Duration: 06h 00m | 3. Control Flow–if() and for() |
How can I get R to assess a situation and respond differently
to different circumstances? How can I get R to repeat the same or similar operations instead of copy-pasting the same code over and over? ::: |
Duration: 07h 00m | 4. Vectorization | How can I operate on all the elements of a vector at once? |
Duration: 07h 25m | 5. Functions Explained | How can I write a new function in R? |
Duration: 08h 25m | Finish |
The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor.
This lesson assumes you have R and RStudio installed on your computer.
- Download and install the latest version of R.
- Download and install RStudio. RStudio is an application (an integrated development environment or IDE) that facilitates the use of R and offers a number of nice additional features. You will need the free Desktop version for your computer.