6.9 Quiz answers
The three components of a function are its body, arguments, and environment.
f1(1)()
returns 11.You’d normally write it in infix style:
1 + (2 * 3)
.Rewriting the call to
mean(c(1:10, NA), na.rm = TRUE)
is easier to understand.No, it does not throw an error because the second argument is never used so it’s never evaluated.
You use
on.exit()
; see Section 6.7.4 for details.