What is the output of the expression nchar("Data")?

What is the output of the expression nchar("Data")?

a) 4
b) 3
c) 5
d) 2

Answer:

a) 4

Explanation:

The nchar() function returns the length of the string, which is 4 in this case.

Reference:

R Programming – String MCQ Questions and Answers

Scroll to Top