What is the result of the expression substr("R Language", 3, 5)?

What is the result of the expression substr("R Language", 3, 5)?

a) “Lang”
b) “Lan”
c) “Language”
d) “R L”

Answer:

b) “Lan”

Explanation:

The substr() function extracts characters from the 3rd to the 5th position, which gives “Lan”.

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