Nice R Code

Punning code better since 2013

Plans for 'Nice R code module', Macquarie University 2013

- - module

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.

We have a tentative schedule of plans for the 2013 Nice R Code module. The module consists of 9 one hour sessions and one 3 hour session. The topics covered fall into two broad categories: workflow and coding. Both are essential for writing nicer code. At the beginning of the module we are going to focus on the first, as this will cross over into all computing work people do.

The first five sessions will be

  1. Introduction & project set up (9 April)
  2. Version control with git (23 April) – this will be a longer session, run with participants from the February software carpentry bootcamp.
  3. Coding style (7 May)
  4. Abstraction and design (21 May)
  5. Testing code (4 June)

Except for the version control session, we will meet from 2-3pm in E8C 212.

These sessions follow very much the same ideas as software carpentry. Where we differ is that we will be focusing on R, and with less emphasis on command line tools and python.

The next sessions (18 June, 2 July, 16 July & 30 July) will either work on specific R skills or continue through issues arising from the first five sessions, depending on demand. Possible specific sessions include

  • Data matching, models and avoiding duplication
  • Higher order functions and functional programming
  • The split/apply/combine pattern
  • Creating better graphs (many possible sessions here)
  • Code reuse and packaging
  • Code profiling and optimisation
  • Using and creating simple databases
  • Text processing
  • Numerical optimisation and algorithms
  • Simulation models (an intro only!)
  • Packages

Along with the skills, we will be doing code review. The idea will be for a participant to meet with us immediately after one session and discuss their problems with us. They then work on their problem over the next fortnight and in the next session we will discuss what the issues were, the possibilities for overcoming them, and the eventual solutions.

Comments