What does the sum() function do in R?

What does the sum() function do in R?

a) Finds the average of numbers
b) Finds the sum of numbers
c) Finds the difference between numbers
d) None of the above

Answer:

b) Finds the sum of numbers

Explanation:

The sum() function in R returns the total sum of all the elements in a vector.

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