

This theme will be explored in depth in functional programming. You can work with them exactly the same way you work with any other type of object. The most important thing to understand about R is that functions are objects in their own right. You’ll see some interesting tricks and techniques in this chapter, but most of what you’ll learn will be more important as the building blocks for more advanced techniques.

The focus of this chapter is to turn your existing, informal knowledge of functions into a rigorous understanding of what functions are and how they work. You’ve probably already created many R functions, and you’re familiar with the basics of how they work. You’re reading the first edition of Advanced R for the latest on this topic, see the Functions chapter in the second edition.įunctions are a fundamental building block of R: to master many of the more advanced techniques in this book, you need a solid foundation in how functions work.
