What will be the output of the following R code snippet?
> g <- function(x) {
+ a <- 3
+ x+a+y
+ ## 'y' is a free variable
+ }
> g(2)
> g <- function(x) {
+ a <- 3
+ x+a+y
+ ## 'y' is a free variable
+ }
> g(2)A. 9
B. 42
C. 8
D. Error
Answer: Option D

Join The Discussion