What will be the output of the following R code?
> f <- function(elt) {
+ elt[, 1]
+ }
> lapply(x, f)
> f <- function(elt) {
+ elt[, 1]
+ }
> lapply(x, f)
A. $a
[1] 1 2
$b
[1] 1 2 3
B. $a
[1] 1 2 3
$b
[1] 1 2 3
C. $a
[1] 1 2 3
$b
[1] 1 2
D. Error
Answer: Option A
Join The Discussion