Hương Trang
New member
What will be the output of the following R code?
A.
B.
C.
D. Error
Code:
> x <- list(a = matrix(1:4, 2, 2), b = matrix(1:6, 3, 2))
> lapply(x, function(elt) { elt[,1] })
Code:
$a
[1] 1 2
$b
[1] 1 2 3
Code:
$a
[1] 1 2 3
$b
[1] 1 2 3
Code:
$a
[1] 1 2 3
$b
[1] 1 2