© Thomas Mailund 2017

Thomas Mailund, Metaprogramming in R, 10.1007/978-1-4842-2881-4_2

2. Inside a Function Call

Thomas Mailund

(1)Aarhus N, Denmark

When you execute the body of a function, as you have seen, you do this in the evaluation environment. This evaluation environment is linked through its parent to the environment where the function was defined. It has its arguments stored as promises that will be evaluated either in the environment where the function was defined (for default parameters) or in the environment where the function was called (for parameters provided to the function there). In the previous chapter, you saw how you could get hold of the formal parameters of a function, the body of the function, and the environment in which ...

Get Metaprogramming in R: Advanced Statistical Programming for Data Science, Analysis and Finance now with O’Reilly online learning.

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