Knowledge Quiz: Lists

Note
  • Click the check-mark button to check your answer.
  • Click the question-mark button to see an explanation of the solution.

Consider the following list, l1.

$name
[1] "bob"

$age
[1] 25

$height
[1] 180

$eyes
[1] "blue"

Which of the following expressions will change the value of the eyes slot in l1 from “blue” to “green”?

  • Correct
  • Wrong: l1 is a list, so we should not use matrix-style selection.
  • Correct
  • Correct
  • Wrong: There is no slot named “4” in l1.
Back to top