Nice R Code

Punning code better since 2013

Nice R code Modules

Here is a list of modules already run by the nicer code team:

Nice R code, Macquarie University 2013

The introduction to R module was run as part of the Genes to Geosciences series at Macquarie University.

Instructors: Rich FitzJohn and Daniel Falster

Dates and times: 2-3pm on the days: April 9, 23*, May 7, 21, June 4, 18, July 2, 16, 30 in room E8C 212.

Welcome to the Nice R code module. This module is targeted at researchers who are already using R and want to write nicer code. By ‘nicer’ we mean code that is easy to write, is easy to read, runs fast, gives reliable results, is easy to reuse in new projects, and is easy to share with collaborators. When you write nice code, you do better science, are more productive, and have more fun.

The module consists of 9 one hour sessions and one 3 hour session. The topics covered fall into two broad categories: workflow and coding. The first five sessions will be

  1. Why write nice code and project set up (9 April), 1hr.
  2. Version control with git, materials and blog (23 April), 3hr session.
  3. Functions and abstractionn, with a blog post on function length, 1hr.
  4. Function development and debugging (21 May), 1hr.
  5. Repeating things (18 June), 2hr.
  6. Plotting work flow and tricks, with a blog post on outputting to pdf (16 July), 1.5hr.
  7. Reproducible reports with knitr (30 July), 1.5hr.

Introduction to R, Macquarie University 2013

The introduction to R module was run as part of the Genes to Geosciences series at Macquarie University.

Instructors: Drew Allen, Rich FitzJohn, Josh Madin, David Nipperess.

Dates: March 20, March 27, April 3 2013

Day 1

  1. Preliminaries: Getting your environment set up.
  2. Getting started: Starting R, using it as a calculator, and variables.
  3. Loading data: Reading in data, viewing, and subsetting.
  4. Writing functions: Avoiding errors and better describing your intent.
  5. Data types: A digression on data types
  6. Repeating things: Introduction to ways of automating repetitive tasks.
  7. Missing data: Another digression on missing data.

See also:

  • a few resources to help you continue learning.

  • a non-exhaustive list of bad habits that you should avoid and tips you should follow.

  • There are a lot of things we don’t cover, for example.

Day 2

Slides on statistics (by Drew Allen).

Day 3

Morning of day three: plotting (by Josh Madin).