Introduction to R
Chapters 1-5 of this tutorial are heavily based on material from the Nice R code modules introduction to R and Nice R code developed by Rich FitzJohn & Daniel Falster. The original website is available under http://nicercode.github.io/modules/ Chapter 6 is based on a Data Carpentry Workshop. with many modifications.
Topics we will cover this morning:
- Preliminaries: Getting your environment set up.
- Getting started: Starting R, using it as a calculator, and variables.
- Loading data: Reading in data, viewing, and subsetting.
- Writing functions: Avoiding errors and better describing your intent.
- Data types: A digression on data types
- ggplot2: Elegant plotting
- Clean Coding & Project Organization (Slideshow):
- Running R from Command line: Rscript
They also made a non-exhaustive list of bad habits that you should avoid and tips you should follow.
Zip file containg Data and Scripts data-and-scripts.zip
Programming Exercises
Exercises