6.9 Quiz answers

  1. The three components of a function are its body, arguments, and environment.

  2. f1(1)() returns 11.

  3. You’d normally write it in infix style: 1 + (2 * 3).

  4. Rewriting the call to mean(c(1:10, NA), na.rm = TRUE) is easier to understand.

  5. No, it does not throw an error because the second argument is never used so it’s never evaluated.

  6. See Sections 6.8.3 and 6.8.4.

  7. You use on.exit(); see Section 6.7.4 for details.