Module 2: The meaning of myMean()

 Hi everyone! 

For this week's assignment, we were asked to evaluate a given function "myMean." So far I have learned the R programming language makes use of variables, functions, and comments. We can assign variables with lists of data to be stored for easier use in other functions. In this example, assignment2 is our variable that holds 9 data values. The myMean function returns the mean of the assignment2 data. This is done using the sum function by adding all the values and dividing it by the length function, or adding the number of values. By just retyping myMean and running the script editor you get the output of 18.66667, seen in the R console.

A neat trick I utilized is the comments in my code (what starts with #) to do the explanation of this function as well!👇

-Ramya's POV

Comments

Popular posts from this blog

Module 10: Varying Multivariate Regression

Final Project: Serially looking at your Cereal Choices

Module 12: Timely Time Series