In this chapter, we cover how to write functions in R. If you are already familiar with the basics of R functions, feel free to skip ahead. We will discuss the way parameters are passed to functions as “promises,” a way of passing parameters known as lazy evaluation. If you are not familiar with that but know how to write functions, you can jump forward to that section. We will also cover how to write infix operators and replacement functions, so if you do not know what these are and how to write them, you can skip ahead to those sections. If you are new to R functions, continue reading.
© Thomas Mailund 2017
Thomas Mailund, Functional Programming in R, 10.1007/978-1-4842-2746-6_1
1. Functions in R
Thomas Mailund1
(1)Aarhus N, Denmark
Get Functional Programming in R: Advanced Statistical Programming for Data Science, Analysis and Finance now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.