Metaprogramming in R: Advanced Statistical Programming for Data Science, Analysis and Finance
by Thomas Mailund
Afterword
You have now seen the various techniques used for manipulating the actual language constructs of R from within R programs. Manipulating the actual language, doing metaprogramming, gives you the tools to extend R in various ways. You can write functions for modifying other functions—as you did with the code for computing the derivative of a function—or you can write small embedded domain-specific languages for manipulating or querying data frames, as done in dplyr and ggplot2 . You know how to do nonstandard evaluation, changing how expressions are evaluated so you can evaluate them in different scopes than what they would usually be evaluated in, which can often simplify how functions are used in pipelines; however, you should be careful ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access