skip to primary navigationskip to content

R object-oriented programming and package development



The course will teach intermediate R object-oriented programming and how to build a fully functional R package.

The course page includes slides and handouts. Other relevant teaching materials are available here and the sequences example package used as template in the course can be found here.



Laurent Gatto, University of Cambridge

Robert Stojnic, University of Cambridge


Audience and Prerequisites

  • A good knowledge of R and some active programming experience is required.
  • Only attending the Introduction to Solving biological problems with R would not provide sufficient background for this course.
  • Familiarity with object-oriented programming would be an advantage, but is not essential.
  • Graduate students, Postdocs and Staff members from the University of Cambridge, Affiliated Institutions and other external Institutions or individuals.


Syllabus, Tools and Resources

During this course you will learn about:

  • What is object-oriented programming; description of the working example; R programming best practices: tips and tricks, environments, coding standards
  • R object-oriented programming: the S3 and S4 OO systems
  • Documentation: documenting functions, methods and data, providing executable examples; documentation using Roxygen; executing R
  • Writing R packages: minimum package structure; combining the written classes/generics/methods and documentation to create a package; building, checking and installing packages
  • Other advanced R programming topics: testing code, unit testing; profiling and debugging; calling C code inside R


Learning Objectives

After this course you should be able to:

  • Use object-oriented programming in R and build your own packages



Book Here

Course materials

Filed under: