Introduction

What is R? It is a user friendly implementation of the S language, developed by Rick Becker, John Chambers and Allan Wilks. You will find the detailed history, philosophy, and the documentation of various capabilities of R in its official documentation. I will not dwell on that here. The goal of this material: Introduction to R is to give you a crash course on the fundamental programming concepts in R. I hope it will help you reap the benefits of CS5701, CS5702, CS5706, MA5636 and MA5638. This material assumes that you have no prior knowledge of programming and are courageous enough to take on R. Do not worry, it will be fun.

The strategy behind using any program is to let the computers do all the hard work. For this purpose we need to issue some instructions. The order of instructions i.e. the algorithm, has to be very precise to the dot. You have to clearly define: what needs to be done, how it has to be done and for how long. There are also rules on how we supply these instructions i.e. syntax.


List of contents

In this course, we will focus on the following topics:

  1. Installation
  2. Variables
  3. Functions
  4. Conditional statements
  5. Loops
  6. Reading and Writing files
  7. Scripting in R
  8. Types of errors
  9. Help

Access to the material

All the files (Rmarkdown and example datasets), used to create this course material, will be available from the CS5701 module on Brunel University Blackboard Learn website.

 

Introduction to R by Dr. Sarath Chandra Dantu

This course material is available under a Creative Commons BY-SA license (CC BY-SA) version 4.0