Multiple Choice Questions for Subsetting in R

My MCQs are based off the Analyzing Patient Data lesson on R Programming, starting more simply with vectors and then moving to matrices.

Question 1

Given the following line of code used to generate vector 'x', how would you subset the first element?

x <- c(10, 20, 30)

Question 2

Given the following line of code to generate matrix 'y', how would you subset the second row?

y <- matrix(nrow=2, ncol=3, 1:6)

Misconceptions