Which function in R is used to search for a pattern in a string?

Which function in R is used to search for a pattern in a string?

a) match()
b) search()
c) grep()
d) pattern()

Answer:

c) grep()

Explanation:

The grep() function is used to search for patterns in strings in R, returning matching elements.

Reference:

R Programming – String MCQ Questions and Answers

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top