Question: In the image below, the data frame on lines 1 through 4 is named StDf. State and Capital are both factors. Which statement returns the results shown on lines 6 and 7?

  1. StDf[1:2,-3]
  2. StDf[1:2,1]
  3. StDf[1:2,]
  4. StDf[1,2,]

Answer: The correct answer of the above question is Option B:StDf[1:2,1]