Jul 28, 2019 in R Language
Q: How will you check if an element 25 is present in a vector?

1 Answer

0 votes
Jul 28, 2019
There are various ways to do this-

It can be done using the match () function- match () function returns the first appearance of a particular element.

The other is to use %in% which returns a Boolean value either true or false.

Is.element () function also returns a Boolean value either true or false based on whether it is present in a vector or not.

Related questions

+2 votes
Jul 28, 2019 in R Language
+2 votes
Jul 28, 2019 in R Language
...