Module 2. Assignment: Function Debugging and Evaluation in R

 Assignment Instructions:


The initial test results can be found below and included the following error message: "Error in myMean(assignment2) : object 'assignment' not found". 


The reason why this function failed is because assignment and someData are undefined variable names. R cannot identify their function and they are not existing objects in the environment, and as a result produces an error message. 


Now, a corrected version of myMean that correctly returns the mean of assignment2 will be computed. 



The mean is  19.07692. In this iteration, we changed the parameters to include 'data' and both sum(data) and length(data) use the same parameter. Consistent variable names are important in R programming to ensure data integrity and cohesion! 



Comments

Popular posts from this blog

R Programming Journal – Christine Jacob

Module 8. Assignment CSV files