The result is 15. The myMean function takes an input vector assignment2, which is the dataset you provided. Inside the function, it uses the sum function to calculate the sum of all the values in assignment2 and then divides that sum by the length of assignment2 to compute the mean (average) of the dataset. The result will be printed to the console.

Comments

Popular posts from this blog

Final Project [LIS4317]

Module # 7 assignment (Visual Analytics)

Module # 8 Input/Output, string manipulation and plyr package