Question:

How will you check if an element 25 is present in a vector?

Answer:

There are various ways to do this-

  1. It can be done using the match () function- match () function returns the first appearance of a particular element.
  2. The other is to use %in% which returns a Boolean value either true or false.
  3. Is.element () function also returns a Boolean value either true or false based on whether it is present in a vector or not.

Keywords:

© 2017 QuizBucket.org