Happy Saturday!

For this week's assignment,  we are going to evaluate and explain the function called myMean.

Answer to question A:

 The function "myMean" calculates the arithmetic mean (average) of a numeric vector. The process of the function is quite simple and very useful in many applications.

Firstly, the sum of all values is computed in the vector by using the "sum(assignment)" function. Afterwards, the result/total is then divided by the number of elements present in the vector by utilizing the "length(assignment) function.

This returns the value as the result. In all honesty, I've noticed that the function "myMean" is essentially the same operation as the "mean()" function in R, but you manually compute the average of the data values.

Comments

Popular posts from this blog