F&ES 720a Introduction to R

M & W 14:30 – 15.50, Kroon G01, Lecture and lab

F 10:00 – 13:00, Kroon 319, R Bootcamp (~office hours)

Credits: 3

Lecturer: Simon Queenborough

TF: Andrew Muehleisen

This course provides an overview and introduction to the statistical software R for the analysis and graphical presentation of natural and social science data.

What is R?

R is a free open-source software environment for statistical computing and graphics. It is widely used by statisticians, biologists, economists, social scientists, . . .

Why should I learn R?

The course will provide the practical skills in R to analyse data and produce publication quality-figures and tables. Some details are specific to R. However, the principles of programming, writing code, command line interface, and collection, storage, analysis and display of data are all transferable skills that will be useful in any software.

Course prerequisites

The course assumes no prior knowledge of R, programming, or the command line interface. However, this course does not teach statistics: Understanding of basic statistics and common statistical tests and analyses is assumed.

You will need a laptop computer

Teaching and learning style

Class time will primarily be used for working through examples and problems as a class or individually. The best way to improve in R is to use it frequently and regularly. Advanced topics will be selected later in the course.

Assessment

The course will be assessed via completion of lessons (25%), completion and assessment of labs (25%), weekly best-practice assignments (25%), and a final data project (25%). Projects will analyze your own (or other available) data.

Our goal is for students to learn and understand R. There are no final examinations and all assessed work may be submitted multiple times for feedback.

Course Reviews

Previous students generally liked the course.

I didn’t hate this course nearly as much as I expected to

We are iterating towards perfection.

Course website

All of the course material will be available here.

Announcements and grades will be posted to Canvas.


Getting started …

1. What is all the fuss about?

This New York Times article describes the background to R, .

2. Install R and RStudio on to your laptop

It is helpful for us as instructors and you as students to all be working in the same environment.

RStudio is a nice, easy, clean program that sits on top of R and works on all operating systems. It is also free.

Windows

To install R:

  1. Open an internet browser and go to www.r-project.org.
  2. Click the “download R” link in the middle of the first paragraph under “Getting Started.”
  3. Select a CRAN location (a mirror site) and click the corresponding link.
  4. Click on the “Download R for Windows” link at the top of the page.
  5. Click on the “install R for the first time” link at the top of the page.
  6. Click “Download R for Windows” and save the executable file somewhere on your computer.
  7. Run the .exe file and follow the installation instructions.

Now that R is installed, you need to download and install RStudio.

To install RStudio:

  1. Go to www.rstudio.com and click on the “Download RStudio” button.
  2. Click on “Download RStudio Desktop.”
  3. Click on the version recommended for your system, or the latest Windows version, and save the executable file.
  4. Run the .exe file and follow the installation instructions.
  5. If a window pops up to ask if you want to install “command line developer tools”, there is no need.

Mac

To install R:

  1. Open an internet browser and go to www.r-project.org.
  2. Click the “download R” link in the middle of the first paragraph under “Getting Started.”
  3. Select a CRAN location (a mirror site) and click the corresponding link.
  4. Click on the “Download R for (Mac) OS X” link at the top of the page.
  5. Click on the file containing the latest version of R under “Files.”
  6. Save the .pkg file, double-click it to open, and follow the installation instructions.

Now that R is installed, you need to download and install RStudio.

To install RStudio:

  1. Go to www.rstudio.com and click on the “Download RStudio” button.
  2. Click on “Download RStudio Desktop.”
  3. Click on the version recommended for your system, or the latest Mac version, and save the .dmg file on your computer.
  4. Double-click it to open, and then drag and drop it to your applications folder.
  5. If a window pops up to ask if you want to install “command line developer tools”, there is no need.

3. To install this course’s lessons

The lessons we will use are available online and you need to download them to your laptop.

  1. Open RStudio
  2. In the console panel, next to the arrow (>), type each line below followed by ENTER:
> install.packages("swirl")
> library(swirl)
> install_course_github("saq", "fes720_Basic")

This will download the most up-to-date lessons, ready for class next week.

You will learn what these commands do later in the course.

4. Get ready for some gRRRReat fun!

What is a pirate’s favourite language?

R!

Credit: wiredforlego, CC BY-NC 2.0


Updated: 2017-08-28