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

Linh Chi

New member
How will you check if an element is present in a vector?
A. Match()
B. Dismatch()
C. Mismatch()
D. Search()
 
Answer: a
Explanation: It can be done using the match () function- match () function returns the first appearance of a particular element. The other way is to use %in% which returns a Boolean value either true or false.
 

Tìm kiếm

Back
Top