Which function is used to extract a substring in R?
a) substr()
b) str_sub()
c) sub()
d) substring()
Answer:
a) substr()
Explanation:
The substr()
function is used to extract a substring from a string, based on starting and ending positions.