-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathbook-description.txt
More file actions
7 lines (4 loc) · 1.4 KB
/
book-description.txt
File metadata and controls
7 lines (4 loc) · 1.4 KB
1
2
3
4
5
6
7
This book gives an introduction to functions in R and how to write functional programs in R. Functional programming is a style of programming, like object-oriented programming, but one that focuses on data transformations and calculations rather than objects and state.
Where in object-oriented programming you model your programs by describing which states an object can be in and how methods will reveal or modify that state, in functional programming you model programs by describing how functions translate input data to output data. Functions themselves are consider data you can manipulate and much of the strength of functional programming comes from manipulating functions, building more complex functions by combining simpler functions.
The R programming language supports both object-oriented programming and functional programming, but it is mainly a functional language. It is not a pure functional language. Pure functional languages will not generally allow you to modify the state of the program by changing values parameters hold and will not allow functions to have side-effects (and need various tricks to deal with program input and output because of it).
In this book I teach you how to write function programs. How to make your functions pure by avoiding side-effects. How to write functions that manipulate other functions and how to construct complex functions using simpler functions as building blocks.