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.