© Thomas Mailund 2018

Thomas Mailund, Domain-Specific Languages in R, https://doi.org/10.1007/978-1-4842-3588-1_5

5. Parsing and Manipulating Expressions

Thomas Mailund

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

A powerful feature of the R programming language is that it readily allows us to treat expressions in the language itself as data that we can examine and modify as part of a program—so-called meta-programming. From within a program we can take a piece of R code and computationally manipulate it before we evaluate it. We need to get hold of the code before it is evaluated, and there are several ways to do that. The simplest is to “quote” expressions, which leaves them as unevaluated expressions.

In this chapter, we will use the following libraries: ...

Get Domain-Specific Languages in R: Advanced Statistical Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.