In "Programming in R Advanced," you will hone your skills to work with a variety of data types and data sources in R. You'll also learn some techniques for programming "in-the-large," when you are trying to provide a suite of functions to flexibly solve a large class of problems. In particular, you'll learn more about functions, environments and closures, and the basics of object oriented programming with S3.
Dr. Hadley Wickham is the author of "ggplot2: Elegant Graphics for Data Analysis (Use R)" and a contributor to Cook & Swayne's "Interactive and Dynamic Graphics for Data Analysis: Using R and GGobi" (2007). His research interests include interactive and dynamic graphics, developing practical tools for data analysis, and in gaining better understanding of complex statistical models through visualization. An Assistant Professor at Rice University, Dr. Wickham has developed 15 R projects, and written numerous articles, chapters, and other papers and in 2006 he won the John Chambers Award for Statistical Computing for his work on the ggplot and reshape R packages. Participants can ask questions and exchange comments with Dr. Wickham via a private discussion board throughout the period.
Aim of Course:
- Anonymous functions.
- Functions that write functions (closures).
- Functions that take functions as arguments (higher-order function).
- Storing functions in data structures.
- R has first order functions: In this session, you will learn how to use these abilities to write effective code.
- Lazy evaluation.
- Computing on the language.
- One of the neat things about R is how it gives you much more
control over evaluation than other programming languages. In this session,
you will learn how functions like subset and transform work.
You will also learn common pitfalls of these techniques and how to avoid
them in your own code. We will conclude with a brief exploration of R
functions that let you modify R code.
- reference classes
- OO is a useful technique for organising large amounts of code in a
way that makes it easier to understand. In this session, you will learn
about the three object oriented systems in base R. I will focus mainly on
S3 and S4, as they differ the most from the OO-systems you are probably
familiar, and are so important for understanding existing R code. We will
touch on the new reference classes, which provide a framework much more
like Java or C#.
- Correct code.
- Maintainable code.
- Fast code.
- The course will conclude with a survey of development best-practices including a discussion of code style, commenting, profiling, improving performance and testing. We will touch on the new byte-code compiler in R, and on writing high-performance code in C++ with the Rcpp package.