Programming with R

Introduction to R for non-programmers using gapminder data.

The goal of this lesson is to teach novice programmers to write modular code and best practices for using R for data analysis. R is commonly used in many scientific disciplines for statistical analysis and its array of third-party packages. We find that many scientists who come to Software Carpentry workshops use R and want to learn more. The emphasis of these materials is to give attendees a strong foundation in the fundamentals of R, and to teach best practices for scientific computing: breaking down analyses into modular units, task automation, and encapsulation.

Note that this workshop will focus on teaching the fundamentals of the programming language R, and will not teach statistical analysis.

A variety of third party packages are used throughout this workshop. These are not necessarily the best, nor are they comprehensive, but they are packages we find useful, and have been chosen primarily for their usability.

Prerequisites

Understand that computers store data and instructions (programs, scripts etc.) in files. Files are organised in directories (folders). Know how to access files not in the working directory by specifying the path.

Schedule

08:30 Check In and Setup Break
09:00 Introduction to R and RStudio How to find your way around RStudio?
How to interact with R?
How to manage your environment?
How to install packages?
09:30 Seeking Help How can I get help in R?
09:50 Data Structures What are the basic data types in R?
How does R handle operations on different data types?
10:15 Coffee Break Break
10:30 Subsetting Data How can I work with subsets of data in R?
11:15 Exploring Data Frames How can access datasets in R?
How do I represent categorical information in R?
How can I manipulate a dataframe?
12:15 Lunch Break
13:15 Control Flow How can I make data-dependent choices in R?
How can I repeat operations in R?
13:45 Dataframe Manipulation with dplyr How can I manipulate dataframes without repeating myself?
14:40 Coffee Break Break
14:55 Creating Publication-Quality Graphics How can I create publication-quality graphics in R?
16:00 Writing Data How can I save plots and data created in R?
16:25 Wrap Up How can I continue to perfect my R skills?
16:30 Finish

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