© Thomas Mailund 2018
Thomas MailundDomain-Specific Languages in Rhttps://doi.org/10.1007/978-1-4842-3588-1_6

6. Lambda Expressions

Thomas Mailund1 
(1)
Aarhus N, Staden København, Denmark
 

With the techniques we have seen so far, we are now able to implement some useful domain-specific languages. In this chapter, we examine a toy example, lambda expressions. It is perhaps not something we would use in real-world code, as it simply gives an alternative syntax to anonymous functions, which are already supported in R. However, it is an excellent example of code that is potentially useful and gives us a chance to experiment with syntax.

We will use the rlang package.

library(rlang)

Anonymous functions

Lambda expressions are Anonymous functions, in other ...

Get Domain-Specific Languages in R: Advanced Statistical Programming 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.