What does the return() function do in R?

What does the return() function do in R?

a) Ends a function and returns a value
b) Prints a message
c) Stops a script
d) None of the above

Answer:

a) Ends a function and returns a value

Explanation:

The return() function in R is used to return a value from a function and end its execution.

Reference:

R Programming – Functions MCQ Questions and Answers

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top