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.