Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What will be the output of the following R code?
> x < – matrix(1:6, 2, 3)
> x[1, ].

What will be the output of the following R code?
> x < - matrix(1:6, 2, 3)
> x[1, ].
a) 1 3 5
b) 2 3 5
c) 3 3 5
d) file

Answer: a
Explanation: Matrices can be subsetted in the usual way with (i,j) type indices where i is the row and j is the column numbers. If only row or only column number is specified, then the respective full row or column is printed.

Join The Discussion