31.4k views
5 votes
X <- 1:3 y <- 10:12 rbind(x, y) yields___.

A) A list containing x and y.
B) A matrix with x and y as rows.
C) A vector with combined elements of x and y.
D) A scalar value.

1 Answer

4 votes

Final answer:

The rbind function in R creates a matrix with vectors as rows, making option B correct: it yields a matrix with x and y as rows.

Step-by-step explanation:

The answer to the question “x <- 1:3 y <- 10:12 rbind(x, y) yields___.” is B) A matrix with x and y as rows. When using the rbind function in R, it combines the vectors x and y by row, resulting in a two-row matrix where the first row consists of the elements of x and the second row consists of the elements of y.

User Influent
by
7.4k points