6. Functional Programming: purrr
A pipeline-based approach to data processing necessitates a functional programming approach. After all, pipelines are compositions of functions, and loops and variable assignment do not work well with pipelines. You are not precluded from imperative programming, but you need to wrap it in functions.
The package
purrr makes functional programming easier. As with the other packages in this book, it will be loaded if you import
tidyverse, but you can load it explicitly with:
I will not describe all the functions in the purrr package; there are many and more could ...
Get R Data Science Quick Reference: A Pocket Guide to APIs, Libraries, and Packages 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.