1 Introduction

This book is a beginner resource for R programming. Each chapter is a tutorial. I highly recommend gaining a firm foundation in programming basics and data types (chapters 3 and 4) as a prerequisite for downstream analysis in R.

Test out this app made using R. Move the slider!

Each chapter contains:

  • description of concept
  • examples of concept
  • link to quiz
  • practice problem and solution

What is programming/coding?

It is the process of creating a set of instructions that tell a computer how to perform a task. It can be done using a variety of computer “languages,” such as R, Java, and python.

Advantages of R?

Here are some benefits of R programming for both beginners and experts.

  • R is open-source, free and accessible (no license/subscription required!). In addition, the R community is very active, helpful and build extensive libraries that may suit your needs.
  • Supports cross-platform usage (ie. machine-independent), which means it can be used on Windows, Mac OS, etc. the same way.
  • It is an interpreted language, meaning you can see the output of your code line-by-line. In other words, it doesn’t need a compiler to make executable programs. R is also an object-oriented programming language.

Why should you learn R?

R has a comprehensive development environment, which will help you perform statistical computing as well as software development.

  1. Delve into statistical computing and analysis.
  2. Analyze large data sets for data science via parallel/distributed computing.
  3. Great for data cleansing and wrangling.
  4. Produce powerful graphics, that is, high quality visualizations, even interactive graphs!
  5. Compatible with other languages such as C, C++, FORTRAN as well as Java, Python.
  6. Use to interact with databases such as MySQL.
  7. Perform machine learning.
  8. Create web applications without any web development knowledge using RShiny.

Other resources to learn R:

  • Course-like: link
  • Comprehensive tutorial pages: link
  • Refresher slides: link

Source code

The tutorials (chapters as R markdown files) and source files for this book can be downloaded here: https://github.com/kazeera/learn-r. This book was created using bookdown.