This module introduces programming skills required for analysis of genetic data, in the R statistical environment. The module assumes prior knowledge of R, to the level described in Module 3. We will briefly review how R scripts are built up from interactive commands, and then discuss how to turn these into R programs based on user-defined functions. We will cover R's debugging system, its tools for enhancing efficiency of code, and its methods for handling errors and warnings. In many genomic applications, R packages already exist to perform specialized statistical and bioinformatic analyses, and we will introduce packages for handling large datasets, and the Bioconductor repository of genomic packages. Users require a laptop and will use it in all sessions.