nerdexam
Dell-EMC

E20-007 · Question #20

What does R code nv <- v[v < 1000] do?

The correct answer is C. Selects the values in vector v that are less than 1000 and assigns them to the vector nv. See the full explanation below for the reasoning.

Question

What does R code nv <- v[v < 1000] do?

Options

  • ARemoves elements of vector v less than 1000 and assigns the elements >= 1000 to nv
  • BSets nv to TRUE or FALSE depending on whether all elements of vector v are less than 1000
  • CSelects the values in vector v that are less than 1000 and assigns them to the vector nv
  • DSelects values of vector v less than 1000,modifies v,and makes a copy to nv

How the community answered

(20 responses)
  • B
    10% (2)
  • C
    85% (17)
  • D
    5% (1)

Community Discussion

No community discussion yet for this question.

Full E20-007 Practice