Which function is used to extract a substring in R?

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.

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