Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer – no Kindle device required. Learn more
Read instantly on your browser with Kindle Cloud Reader.
Using your mobile phone camera, scan the code below and download the Kindle app.
Functional Programming in R: Advanced Statistical Programming for Data Science, Analysis and Finance Paperback – March 29 2017
| Thomas Mailund (Author) Find all the books, read about the author and more. See search results for this author |
Enhance your purchase
Master functions and discover how to write functional programs in R. In this concise book, you'll make your functions pure by avoiding side-effects; you'll write functions that manipulate other functions, and you'll construct complex functions using simpler functions as building blocks.
InFunctional Programming in R, you'll see how we can replace loops, which can have side-effects, with recursive functions that can more easily avoid them. In addition, the book covers why you shouldn't use recursion when loops are more efficient and how you can get the best of both worlds.
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 considered to be data you can manipulate and much of the strength of functional programming comes from manipulating functions; that is, building more complex functions by combining simpler functions.
What You'll Learn
- Write functions in R including infix operators and replacement functions
- Create higher order functions
- Pass functions to other functions and start using functions as data you can manipulate
- Use Filer, Map and Reduce functions to express the intent behind code clearly and safely
- Build new functions from existing functions without necessarily writing any new functions, using point-free programming
- Create functions that carry data along with them
Who This Book Is For
Those with at least some experience with programming in R.
- ISBN-10148422745X
- ISBN-13978-1484227459
- Edition1st ed.
- PublisherApress
- Publication dateMarch 29 2017
- LanguageEnglish
- Dimensions15.49 x 0.71 x 23.5 cm
- Print length119 pages
Customers who bought this item also bought
Product description
Review
From the Back Cover
In Functional Programming in R, you’ll see how we can replace loops, which can have side-effects, with recursive functions that can more easily avoid them. In addition, the book covers why you shouldn't use recursion when loops are more efficient and how you can get the best of both worlds.
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 considered to be data you can manipulate and much of the strength of functional programming comes from manipulating functions; that is, building more complex functions by combining simpler functions.
You will:
- Write functions in R including infix operators and replacement functions
- Create higher order functions
- Pass functions to other functions and start using functions as data you can manipulate
- Use Filer, Map and Reduce functions to express the intent behind code clearly and safely
- Build new functions from existing functions without necessarily writing any new functions, using point-free programming
- Create functions that carry data along with them
About the Author
Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.
Product details
- Publisher : Apress; 1st ed. edition (March 29 2017)
- Language : English
- Paperback : 119 pages
- ISBN-10 : 148422745X
- ISBN-13 : 978-1484227459
- Item weight : 454 g
- Dimensions : 15.49 x 0.71 x 23.5 cm
- Customer Reviews:
About the author

I am an associate professor in bioinformatics at Aarhus University, Denmark. My background in math and computer science but for the last decade my main focus has been on genetics and evolutionary studies, particularly comparative genomics, speciation, and gene flow between emerging species.
I write as a hobby, but my books are all focused on topics I teach in my daily work, where I teach several classes on data science, statistics, programming, and computer science. I try to write the kinds of books I would like to use in my own teaching, or the kinds of books I would like to have had when I learned the topics myself.
I do have some ambitions of writing popular science books as well, but I have not had the courage to try my writing skills on that yet. So far, I have stuck to more technical topics where I feel more at home. Still, that can't go on forever, so some day I will dare to write about genetics and human evolution without hiding behind maths.
Customer reviews
Top reviews from other countries
I have been programming for a living and using S, S-Plus or R for 25+ years and I gave up on this after 17% because it was too difficult to follow. The author(s) fails to define terms (for example, the rigorous computer science definition of an R expression was needed before bringing up removing invisible status of returned objects). They fail to adequately explain advanced programming functions. For example, for the code chunk parameters <- function(...) eval(substitute(alist(...))) on page 15 there is an explanation of alist(), an inadequate explanation of substitute and no explanation of eval(). The computer science definition of "side effects" was missing and the inferred definition is not entirely consistent with what I learned from my computer science classes. "Simple" examples like f <- function(a) function(b) a + b ; f(2)(2) are not adequately explained before the author(s) expands on them.
This is not a 0 star book. There are some useful bits of information here (the example showing how ... works in nested functions was nicely explained) but the book desperately needed another author to add explanations before this was released.
